mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-03 10:22:45 -04:00
GraphicsOutputBase
This commit is contained in:
parent
040dcfc333
commit
8d234769ab
@ -436,7 +436,7 @@ set_inverted(bool inverted) {
|
|||||||
|
|
||||||
////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////
|
||||||
// Function: GraphicsOutput::set_sort
|
// Function: GraphicsOutput::set_sort
|
||||||
// Access: Published
|
// Access: Published, Virtual
|
||||||
// Description: Adjusts the sorting order of this particular
|
// Description: Adjusts the sorting order of this particular
|
||||||
// GraphicsOutput, relative to other GraphicsOutputs.
|
// GraphicsOutput, relative to other GraphicsOutputs.
|
||||||
////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////
|
||||||
|
@ -23,6 +23,7 @@
|
|||||||
#include "graphicsStateGuardian.h"
|
#include "graphicsStateGuardian.h"
|
||||||
#include "drawableRegion.h"
|
#include "drawableRegion.h"
|
||||||
#include "renderBuffer.h"
|
#include "renderBuffer.h"
|
||||||
|
#include "graphicsOutputBase.h"
|
||||||
|
|
||||||
#include "typedWritableReferenceCount.h"
|
#include "typedWritableReferenceCount.h"
|
||||||
#include "pandaNode.h"
|
#include "pandaNode.h"
|
||||||
@ -58,7 +59,7 @@ class GraphicsEngine;
|
|||||||
// TypedWritableReferenceCount instead of
|
// TypedWritableReferenceCount instead of
|
||||||
// TypedReferenceCount for that convenience.
|
// TypedReferenceCount for that convenience.
|
||||||
////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////
|
||||||
class EXPCL_PANDA_DISPLAY GraphicsOutput : public TypedWritableReferenceCount, public DrawableRegion {
|
class EXPCL_PANDA_DISPLAY GraphicsOutput : public GraphicsOutputBase, public DrawableRegion {
|
||||||
protected:
|
protected:
|
||||||
GraphicsOutput(GraphicsEngine *engine,
|
GraphicsOutput(GraphicsEngine *engine,
|
||||||
GraphicsPipe *pipe,
|
GraphicsPipe *pipe,
|
||||||
@ -135,7 +136,7 @@ PUBLISHED:
|
|||||||
INLINE void clear_delete_flag();
|
INLINE void clear_delete_flag();
|
||||||
INLINE bool get_delete_flag() const;
|
INLINE bool get_delete_flag() const;
|
||||||
|
|
||||||
void set_sort(int sort);
|
virtual void set_sort(int sort);
|
||||||
INLINE int get_sort() const;
|
INLINE int get_sort() const;
|
||||||
|
|
||||||
INLINE void set_child_sort(int child_sort);
|
INLINE void set_child_sort(int child_sort);
|
||||||
@ -313,9 +314,9 @@ public:
|
|||||||
return _type_handle;
|
return _type_handle;
|
||||||
}
|
}
|
||||||
static void init_type() {
|
static void init_type() {
|
||||||
TypedWritableReferenceCount::init_type();
|
GraphicsOutputBase::init_type();
|
||||||
register_type(_type_handle, "GraphicsOutput",
|
register_type(_type_handle, "GraphicsOutput",
|
||||||
TypedWritableReferenceCount::get_class_type());
|
GraphicsOutputBase::get_class_type());
|
||||||
}
|
}
|
||||||
virtual TypeHandle get_type() const {
|
virtual TypeHandle get_type() const {
|
||||||
return get_class_type();
|
return get_class_type();
|
||||||
|
@ -1305,6 +1305,23 @@ clear_state_and_transform() {
|
|||||||
_state_mask.clear();
|
_state_mask.clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
////////////////////////////////////////////////////////////////////
|
||||||
|
// Function: GraphicsStateGuardian::remove_window
|
||||||
|
// Access: Public, Virtual
|
||||||
|
// Description: This is simply a transparent call to
|
||||||
|
// GraphicsEngine::remove_window(). It exists primary
|
||||||
|
// to support removing a window from that compiles
|
||||||
|
// before the display module, and therefore has no
|
||||||
|
// knowledge of a GraphicsEngine object.
|
||||||
|
////////////////////////////////////////////////////////////////////
|
||||||
|
void GraphicsStateGuardian::
|
||||||
|
remove_window(GraphicsOutputBase *window) {
|
||||||
|
nassertv(_engine != (GraphicsEngine *)NULL);
|
||||||
|
GraphicsOutput *win;
|
||||||
|
DCAST_INTO_V(win, window);
|
||||||
|
_engine->remove_window(win);
|
||||||
|
}
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////
|
||||||
// Function: GraphicsStateGuardian::prepare_lens
|
// Function: GraphicsStateGuardian::prepare_lens
|
||||||
// Access: Public, Virtual
|
// Access: Public, Virtual
|
||||||
|
@ -228,6 +228,8 @@ public:
|
|||||||
virtual void clear_before_callback();
|
virtual void clear_before_callback();
|
||||||
virtual void clear_state_and_transform();
|
virtual void clear_state_and_transform();
|
||||||
|
|
||||||
|
virtual void remove_window(GraphicsOutputBase *window);
|
||||||
|
|
||||||
virtual CPT(TransformState) calc_projection_mat(const Lens *lens);
|
virtual CPT(TransformState) calc_projection_mat(const Lens *lens);
|
||||||
virtual bool prepare_lens();
|
virtual bool prepare_lens();
|
||||||
|
|
||||||
|
@ -11,15 +11,18 @@
|
|||||||
#define SOURCES \
|
#define SOURCES \
|
||||||
config_gsgbase.h \
|
config_gsgbase.h \
|
||||||
displayRegionBase.I displayRegionBase.h \
|
displayRegionBase.I displayRegionBase.h \
|
||||||
|
graphicsOutputBase.I graphicsOutputBase.h \
|
||||||
graphicsStateGuardianBase.h
|
graphicsStateGuardianBase.h
|
||||||
|
|
||||||
#define INCLUDED_SOURCES \
|
#define INCLUDED_SOURCES \
|
||||||
config_gsgbase.cxx \
|
config_gsgbase.cxx \
|
||||||
displayRegionBase.cxx \
|
displayRegionBase.cxx \
|
||||||
|
graphicsOutputBase.cxx \
|
||||||
graphicsStateGuardianBase.cxx
|
graphicsStateGuardianBase.cxx
|
||||||
|
|
||||||
#define INSTALL_HEADERS \
|
#define INSTALL_HEADERS \
|
||||||
displayRegionBase.I displayRegionBase.h \
|
displayRegionBase.I displayRegionBase.h \
|
||||||
|
graphicsOutputBase.I graphicsOutputBase.h \
|
||||||
graphicsStateGuardianBase.h
|
graphicsStateGuardianBase.h
|
||||||
|
|
||||||
#define IGATESCAN all
|
#define IGATESCAN all
|
||||||
|
@ -14,6 +14,7 @@
|
|||||||
|
|
||||||
#include "config_gsgbase.h"
|
#include "config_gsgbase.h"
|
||||||
#include "displayRegionBase.h"
|
#include "displayRegionBase.h"
|
||||||
|
#include "graphicsOutputBase.h"
|
||||||
#include "graphicsStateGuardianBase.h"
|
#include "graphicsStateGuardianBase.h"
|
||||||
|
|
||||||
#include "dconfig.h"
|
#include "dconfig.h"
|
||||||
@ -22,5 +23,6 @@ Configure(config_gsgbase);
|
|||||||
|
|
||||||
ConfigureFn(config_gsgbase) {
|
ConfigureFn(config_gsgbase) {
|
||||||
DisplayRegionBase::init_type();
|
DisplayRegionBase::init_type();
|
||||||
|
GraphicsOutputBase::init_type();
|
||||||
GraphicsStateGuardianBase::init_type();
|
GraphicsStateGuardianBase::init_type();
|
||||||
}
|
}
|
||||||
|
14
panda/src/gsgbase/graphicsOutputBase.I
Normal file
14
panda/src/gsgbase/graphicsOutputBase.I
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
// Filename: graphicsOutputBase.I
|
||||||
|
// Created by: drose (27May09)
|
||||||
|
//
|
||||||
|
////////////////////////////////////////////////////////////////////
|
||||||
|
//
|
||||||
|
// PANDA 3D SOFTWARE
|
||||||
|
// Copyright (c) Carnegie Mellon University. All rights reserved.
|
||||||
|
//
|
||||||
|
// All use of this software is subject to the terms of the revised BSD
|
||||||
|
// license. You should have received a copy of this license along
|
||||||
|
// with this source code in a file named "LICENSE."
|
||||||
|
//
|
||||||
|
////////////////////////////////////////////////////////////////////
|
||||||
|
|
17
panda/src/gsgbase/graphicsOutputBase.cxx
Normal file
17
panda/src/gsgbase/graphicsOutputBase.cxx
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
// Filename: graphicsOutputBase.cxx
|
||||||
|
// Created by: drose (27May09)
|
||||||
|
//
|
||||||
|
////////////////////////////////////////////////////////////////////
|
||||||
|
//
|
||||||
|
// PANDA 3D SOFTWARE
|
||||||
|
// Copyright (c) Carnegie Mellon University. All rights reserved.
|
||||||
|
//
|
||||||
|
// All use of this software is subject to the terms of the revised BSD
|
||||||
|
// license. You should have received a copy of this license along
|
||||||
|
// with this source code in a file named "LICENSE."
|
||||||
|
//
|
||||||
|
////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
#include "graphicsOutputBase.h"
|
||||||
|
|
||||||
|
TypeHandle GraphicsOutputBase::_type_handle;
|
54
panda/src/gsgbase/graphicsOutputBase.h
Normal file
54
panda/src/gsgbase/graphicsOutputBase.h
Normal file
@ -0,0 +1,54 @@
|
|||||||
|
// Filename: graphicsOutputBase.h
|
||||||
|
// Created by: drose (27May09)
|
||||||
|
//
|
||||||
|
////////////////////////////////////////////////////////////////////
|
||||||
|
//
|
||||||
|
// PANDA 3D SOFTWARE
|
||||||
|
// Copyright (c) Carnegie Mellon University. All rights reserved.
|
||||||
|
//
|
||||||
|
// All use of this software is subject to the terms of the revised BSD
|
||||||
|
// license. You should have received a copy of this license along
|
||||||
|
// with this source code in a file named "LICENSE."
|
||||||
|
//
|
||||||
|
////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
#ifndef GRAPHICSOUTPUTBASE_H
|
||||||
|
#define GRAPHICSOUTPUTBASE_H
|
||||||
|
|
||||||
|
#include "pandabase.h"
|
||||||
|
#include "typedWritableReferenceCount.h"
|
||||||
|
|
||||||
|
////////////////////////////////////////////////////////////////////
|
||||||
|
// Class : GraphicsOutputBase
|
||||||
|
// Description : An abstract base class for GraphicsOutput, for all
|
||||||
|
// the usual reasons.
|
||||||
|
////////////////////////////////////////////////////////////////////
|
||||||
|
class EXPCL_PANDA_GSGBASE GraphicsOutputBase : public TypedWritableReferenceCount {
|
||||||
|
PUBLISHED:
|
||||||
|
virtual void set_sort(int sort)=0;
|
||||||
|
|
||||||
|
public:
|
||||||
|
static TypeHandle get_class_type() {
|
||||||
|
return _type_handle;
|
||||||
|
}
|
||||||
|
static void init_type() {
|
||||||
|
TypedWritableReferenceCount::init_type();
|
||||||
|
register_type(_type_handle, "GraphicsOutputBase",
|
||||||
|
TypedWritableReferenceCount::get_class_type());
|
||||||
|
}
|
||||||
|
virtual TypeHandle get_type() const {
|
||||||
|
return get_class_type();
|
||||||
|
}
|
||||||
|
virtual TypeHandle force_init_type() {init_type(); return get_class_type();}
|
||||||
|
|
||||||
|
private:
|
||||||
|
static TypeHandle _type_handle;
|
||||||
|
|
||||||
|
friend class GraphicsPipe;
|
||||||
|
friend class GraphicsEngine;
|
||||||
|
friend class DisplayRegion;
|
||||||
|
};
|
||||||
|
|
||||||
|
#include "graphicsOutputBase.I"
|
||||||
|
|
||||||
|
#endif
|
@ -27,6 +27,7 @@ class Thread;
|
|||||||
class RenderBuffer;
|
class RenderBuffer;
|
||||||
class GraphicsWindow;
|
class GraphicsWindow;
|
||||||
class NodePath;
|
class NodePath;
|
||||||
|
class GraphicsOutputBase;
|
||||||
|
|
||||||
class VertexBufferContext;
|
class VertexBufferContext;
|
||||||
class IndexBufferContext;
|
class IndexBufferContext;
|
||||||
@ -131,6 +132,8 @@ public:
|
|||||||
virtual void clear_before_callback()=0;
|
virtual void clear_before_callback()=0;
|
||||||
virtual void clear_state_and_transform()=0;
|
virtual void clear_state_and_transform()=0;
|
||||||
|
|
||||||
|
virtual void remove_window(GraphicsOutputBase *window)=0;
|
||||||
|
|
||||||
#ifndef CPPPARSER
|
#ifndef CPPPARSER
|
||||||
// We hide this from interrogate, so that it will be properly
|
// We hide this from interrogate, so that it will be properly
|
||||||
// exported from the GraphicsStateGuardian class, later.
|
// exported from the GraphicsStateGuardian class, later.
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
|
|
||||||
#include "config_gsgbase.cxx"
|
#include "config_gsgbase.cxx"
|
||||||
#include "displayRegionBase.cxx"
|
#include "displayRegionBase.cxx"
|
||||||
|
#include "graphicsOutputBase.cxx"
|
||||||
#include "graphicsStateGuardianBase.cxx"
|
#include "graphicsStateGuardianBase.cxx"
|
||||||
|
|
||||||
|
@ -61,14 +61,10 @@ set_shadow_caster(bool caster, int buffer_xsize, int buffer_ysize, int buffer_so
|
|||||||
_sb_xsize = buffer_xsize;
|
_sb_xsize = buffer_xsize;
|
||||||
_sb_ysize = buffer_ysize;
|
_sb_ysize = buffer_ysize;
|
||||||
if (buffer_sort != _sb_sort) {
|
if (buffer_sort != _sb_sort) {
|
||||||
// drose: Temporarily commenting out--can't call set_sort() on an
|
|
||||||
// undefined class.
|
|
||||||
/*
|
|
||||||
ShadowBuffers::iterator it;
|
ShadowBuffers::iterator it;
|
||||||
for(it = _sbuffers.begin(); it != _sbuffers.end(); ++it) {
|
for(it = _sbuffers.begin(); it != _sbuffers.end(); ++it) {
|
||||||
it->second->set_sort(buffer_sort);
|
(*it).second->set_sort(buffer_sort);
|
||||||
}
|
}
|
||||||
*/
|
|
||||||
_sb_sort = buffer_sort;
|
_sb_sort = buffer_sort;
|
||||||
}
|
}
|
||||||
set_active(caster);
|
set_active(caster);
|
||||||
|
@ -75,13 +75,9 @@ LightLensNode(const LightLensNode ©) :
|
|||||||
void LightLensNode::
|
void LightLensNode::
|
||||||
clear_shadow_buffers() {
|
clear_shadow_buffers() {
|
||||||
ShadowBuffers::iterator it;
|
ShadowBuffers::iterator it;
|
||||||
// drose: Temporarily commenting out--can't call get_engine() or
|
|
||||||
// remove_window() on an undefined class.
|
|
||||||
/*
|
|
||||||
for(it = _sbuffers.begin(); it != _sbuffers.end(); ++it) {
|
for(it = _sbuffers.begin(); it != _sbuffers.end(); ++it) {
|
||||||
it->first->get_engine()->remove_window(it->second);
|
(*it).first->remove_window((*it).second);
|
||||||
}
|
}
|
||||||
*/
|
|
||||||
_sbuffers.clear();
|
_sbuffers.clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -20,7 +20,7 @@
|
|||||||
#include "light.h"
|
#include "light.h"
|
||||||
#include "camera.h"
|
#include "camera.h"
|
||||||
#include "graphicsStateGuardianBase.h"
|
#include "graphicsStateGuardianBase.h"
|
||||||
#include "typedWritableReferenceCount.h"
|
#include "graphicsOutputBase.h"
|
||||||
|
|
||||||
class ShaderGenerator;
|
class ShaderGenerator;
|
||||||
|
|
||||||
@ -49,10 +49,8 @@ protected:
|
|||||||
int _sb_xsize, _sb_ysize, _sb_sort;
|
int _sb_xsize, _sb_ysize, _sb_sort;
|
||||||
double _push_bias;
|
double _push_bias;
|
||||||
|
|
||||||
// drose: This is really a map of GSG -> GraphicsOutput.
|
// This is really a map of GSG -> GraphicsOutput.
|
||||||
// Temporarily changed it to TypedWritableReferenceCount to allow
|
typedef pmap<PT(GraphicsStateGuardianBase), PT(GraphicsOutputBase) > ShadowBuffers;
|
||||||
// compilation without circular dependencies.
|
|
||||||
typedef pmap<CPT(GraphicsStateGuardianBase), PT(TypedWritableReferenceCount) > ShadowBuffers;
|
|
||||||
ShadowBuffers _sbuffers;
|
ShadowBuffers _sbuffers;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user