mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-01 01:07:51 -04:00
restore GeomContexts and display lists
This commit is contained in:
parent
1ed5d5c0e3
commit
50f7d0bce7
@ -1,7 +0,0 @@
|
||||
#!bash
|
||||
|
||||
rm *.I
|
||||
rm *.cxx
|
||||
rm *.h
|
||||
rm pp.dep
|
||||
rm Makefile
|
@ -1,132 +0,0 @@
|
||||
// Filename: config_crgsg.cxx
|
||||
// Created by: drose (06Oct99)
|
||||
//
|
||||
////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// PANDA 3D SOFTWARE
|
||||
// Copyright (c) 2001 - 2004, Disney Enterprises, Inc. All rights reserved
|
||||
//
|
||||
// All use of this software is subject to the terms of the Panda 3d
|
||||
// Software license. You should have received a copy of this license
|
||||
// along with this source code; you will also find a current copy of
|
||||
// the license at http://etc.cmu.edu/panda3d/docs/license/ .
|
||||
//
|
||||
// To contact the maintainers of this program write to
|
||||
// panda3d-general@lists.sourceforge.net .
|
||||
//
|
||||
////////////////////////////////////////////////////////////////////
|
||||
|
||||
#include "config_crgsg.h"
|
||||
#include "crGraphicsStateGuardian.h"
|
||||
#include "crSavedFrameBuffer.h"
|
||||
#include "crTextureContext.h"
|
||||
#include "crGeomNodeContext.h"
|
||||
|
||||
#include "dconfig.h"
|
||||
|
||||
Configure(config_crgsg);
|
||||
NotifyCategoryDef(crgsg, ":display:gsg");
|
||||
|
||||
// Configure this variable true to cause the CRGSG to show each
|
||||
// transform space it renders by drawing a little unit axis. This
|
||||
// cannot be enabled when the player is compiled in NDEBUG mode.
|
||||
bool cr_show_transforms = config_crgsg.GetBool("cr-show-transforms", false);
|
||||
|
||||
// Configure this true to chromium.Hint the textures into the cheapest
|
||||
// possible mode.
|
||||
bool cr_cheap_textures = config_crgsg.GetBool("cr-cheap-textures", false);
|
||||
|
||||
// Configure this true to perform a cull traversal over the geometry
|
||||
// by default, false otherwise. The cull traversal provides support
|
||||
// for state-sorting, z-sorting, and binning.
|
||||
bool cr_cull_traversal = config_crgsg.GetBool("cr-cull-traversal", true);
|
||||
|
||||
// Configure this true to disable the use of mipmapping in the
|
||||
// renderer.
|
||||
bool cr_ignore_mipmaps = config_crgsg.GetBool("cr-ignore-mipmaps", false);
|
||||
|
||||
// Configure this true to enable full trilinear mipmapping on every
|
||||
// texture, whether it asks for it or not.
|
||||
bool cr_force_mipmaps = config_crgsg.GetBool("cr-force-mipmaps", false);
|
||||
|
||||
// Configure this true to cause mipmaps to be rendered with phony
|
||||
// colors, using mipmap_level_*.rgb if they are available.
|
||||
bool cr_show_mipmaps = config_crgsg.GetBool("cr-show-mipmaps", false);
|
||||
|
||||
// Configure this true to cause the generated mipmap images to be
|
||||
// written out to image files on the disk as they are generated.
|
||||
bool cr_save_mipmaps = config_crgsg.GetBool("cr-save-mipmaps", false);
|
||||
|
||||
// Configure this true to cause all lighting normals to automatically
|
||||
// be normalized by the graphics hardware before rendering. This is
|
||||
// necessary if you intend to render things under scale transforms and
|
||||
// expect lighting to work correctly. Maybe one day there will be
|
||||
// another way to set this at runtime, instead of only as a configure
|
||||
// variable.
|
||||
bool cr_auto_normalize_lighting = config_crgsg.GetBool("auto-normalize-lighting", false);
|
||||
|
||||
// Configure this true to try to implement decals using a
|
||||
// DepthOffsetAttrib, false to do them with the more reliable 3-pass
|
||||
// rendering method instead.
|
||||
bool cr_depth_offset_decals = config_crgsg.GetBool("depth-offset-decals", false);
|
||||
|
||||
// Configure this true to indicate the current version of GL fully
|
||||
// supports textures with B, G, R ordering; false if it only supports
|
||||
// R, G, B. false will always work, but true might be faster if the
|
||||
// implementation supports it.
|
||||
#ifdef GL_BGR
|
||||
bool cr_supports_bgr = config_crgsg.GetBool("cr-supports-bgr", false);
|
||||
#else
|
||||
// If it's not even defined, we can't use it.
|
||||
bool cr_supports_bgr = false;
|
||||
#endif // GL_BGR
|
||||
|
||||
CRDecalType cr_decal_type = GDT_offset;
|
||||
|
||||
static CRDecalType
|
||||
parse_decal_type(const string &type) {
|
||||
if (type == "mask") {
|
||||
return GDT_mask;
|
||||
} else if (type == "blend") {
|
||||
return GDT_blend;
|
||||
} else if (type == "offset") {
|
||||
return GDT_offset;
|
||||
}
|
||||
crgsg_cat.error() << "Invalid cr-decal-type: " << type << "\n";
|
||||
return GDT_offset;
|
||||
}
|
||||
|
||||
ConfigureFn(config_crgsg) {
|
||||
init_libcrgsg();
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
// Function: init_libcrgsg
|
||||
// Description: Initializes the library. This must be called at
|
||||
// least once before any of the functions or classes in
|
||||
// this library can be used. Normally it will be
|
||||
// called by the static initializers and need not be
|
||||
// called explicitly, but special cases exist.
|
||||
////////////////////////////////////////////////////////////////////
|
||||
void
|
||||
init_libcrgsg() {
|
||||
static bool initialized = false;
|
||||
if (initialized) {
|
||||
return;
|
||||
}
|
||||
initialized = true;
|
||||
|
||||
string decal_type = config_crgsg.GetString("cr-decal-type", "");
|
||||
if (!decal_type.empty()) {
|
||||
cr_decal_type = parse_decal_type(decal_type);
|
||||
}
|
||||
|
||||
CRGraphicsStateGuardian::init_type();
|
||||
CRSavedFrameBuffer::init_type();
|
||||
CRTextureContext::init_type();
|
||||
CRGeomNodeContext::init_type();
|
||||
|
||||
GraphicsStateGuardian::get_factory().register_factory
|
||||
(CRGraphicsStateGuardian::get_class_type(),
|
||||
CRGraphicsStateGuardian::make_GlGraphicsStateGuardian);
|
||||
}
|
@ -1,49 +0,0 @@
|
||||
// Filename: config_crgsg.h
|
||||
// Created by: drose (06Oct99)
|
||||
//
|
||||
////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// PANDA 3D SOFTWARE
|
||||
// Copyright (c) 2001 - 2004, Disney Enterprises, Inc. All rights reserved
|
||||
//
|
||||
// All use of this software is subject to the terms of the Panda 3d
|
||||
// Software license. You should have received a copy of this license
|
||||
// along with this source code; you will also find a current copy of
|
||||
// the license at http://etc.cmu.edu/panda3d/docs/license/ .
|
||||
//
|
||||
// To contact the maintainers of this program write to
|
||||
// panda3d-general@lists.sourceforge.net .
|
||||
//
|
||||
////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef CONFIG_GLGSG_H
|
||||
#define CONFIG_GLGSG_H
|
||||
|
||||
#include "pandabase.h"
|
||||
#include "notifyCategoryProxy.h"
|
||||
|
||||
NotifyCategoryDecl(crgsg, EXPCL_PANDACR, EXPTP_PANDACR);
|
||||
|
||||
extern bool cr_show_transforms;
|
||||
extern bool cr_cheap_textures;
|
||||
extern bool cr_cull_traversal;
|
||||
extern bool cr_ignore_mipmaps;
|
||||
extern bool cr_force_mipmaps;
|
||||
extern bool cr_show_mipmaps;
|
||||
extern bool cr_save_mipmaps;
|
||||
extern bool cr_auto_normalize_lighting;
|
||||
extern bool cr_depth_offset_decals;
|
||||
extern bool cr_supports_bgr;
|
||||
|
||||
// Ways to implement decals.
|
||||
enum CRDecalType {
|
||||
GDT_mask, // GL 1.0 style, involving three steps
|
||||
GDT_blend, // As above, but slower; a hack for broken nVidia driver
|
||||
GDT_offset // The fastest, using GL 1.1 style chromium.PolygonOffset
|
||||
};
|
||||
extern CRDecalType cr_decal_type;
|
||||
|
||||
|
||||
extern EXPCL_PANDACR void init_libcrgsg();
|
||||
|
||||
#endif
|
@ -1,21 +0,0 @@
|
||||
// Filename: chromium.GeomNodeContext.cxx
|
||||
// Created by: drose (12Jun01)
|
||||
//
|
||||
////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// PANDA 3D SOFTWARE
|
||||
// Copyright (c) 2001 - 2004, Disney Enterprises, Inc. All rights reserved
|
||||
//
|
||||
// All use of this software is subject to the terms of the Panda 3d
|
||||
// Software license. You should have received a copy of this license
|
||||
// along with this source code; you will also find a current copy of
|
||||
// the license at http://etc.cmu.edu/panda3d/docs/license/ .
|
||||
//
|
||||
// To contact the maintainers of this program write to
|
||||
// panda3d-general@lists.sourceforge.net .
|
||||
//
|
||||
////////////////////////////////////////////////////////////////////
|
||||
|
||||
#include "crGeomNodeContext.h"
|
||||
|
||||
TypeHandle CRGeomNodeContext::_type_handle;
|
@ -1,88 +0,0 @@
|
||||
// Filename: chromium.GeomNodeContext.h
|
||||
// Created by: drose (12Jun01)
|
||||
//
|
||||
////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// PANDA 3D SOFTWARE
|
||||
// Copyright (c) 2001 - 2004, Disney Enterprises, Inc. All rights reserved
|
||||
//
|
||||
// All use of this software is subject to the terms of the Panda 3d
|
||||
// Software license. You should have received a copy of this license
|
||||
// along with this source code; you will also find a current copy of
|
||||
// the license at http://etc.cmu.edu/panda3d/docs/license/ .
|
||||
//
|
||||
// To contact the maintainers of this program write to
|
||||
// panda3d-general@lists.sourceforge.net .
|
||||
//
|
||||
////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef CRGEOMNODECONTEXT_H
|
||||
#define CRGEOMNODECONTEXT_H
|
||||
|
||||
#include "pandabase.h"
|
||||
|
||||
#ifdef WIN32_VC
|
||||
// Must include windows.h before gl.h on NT
|
||||
#define WIN32_LEAN_AND_MEAN
|
||||
#include <windows.h>
|
||||
#undef WIN32_LEAN_AND_MEAN
|
||||
#endif
|
||||
|
||||
|
||||
#include <GL/gl.h>
|
||||
// Chromium specific
|
||||
#ifdef WIN32_VC // [
|
||||
#define WINDOWS 1
|
||||
#endif //]
|
||||
#include "cr_glwrapper.h"
|
||||
#include "cr_applications.h"
|
||||
#include "cr_spu.h"
|
||||
extern SPUDispatchTable chromium;
|
||||
|
||||
#include "geomNodeContext.h"
|
||||
#include "geomNode.h"
|
||||
#include "pvector.h"
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
// Class : CRGeomNodeContext
|
||||
// Description :
|
||||
////////////////////////////////////////////////////////////////////
|
||||
class EXPCL_PANDACR CRGeomNodeContext : public GeomNodeContext {
|
||||
public:
|
||||
INLINE CRGeomNodeContext(GeomNode *node);
|
||||
|
||||
// The GL display list index that draws the contents of this
|
||||
// GeomNode.
|
||||
GLuint _index;
|
||||
|
||||
// A list of the dynamic Geoms within the GeomNode; these aren't
|
||||
// part of the above display list.
|
||||
typedef pvector<PT(dDrawable) > Geoms;
|
||||
Geoms _dynamic_geoms;
|
||||
|
||||
// The number of vertices represented by the display list. This is
|
||||
// strictly for the benefit of PStats reporting.
|
||||
DO_PSTATS_STUFF(int _num_verts;)
|
||||
|
||||
public:
|
||||
static TypeHandle get_class_type() {
|
||||
return _type_handle;
|
||||
}
|
||||
static void init_type() {
|
||||
GeomNodeContext::init_type();
|
||||
register_type(_type_handle, "CRGeomNodeContext",
|
||||
GeomNodeContext::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;
|
||||
};
|
||||
|
||||
#include "crGeomNodeContext.I"
|
||||
|
||||
#endif
|
||||
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@ -1,362 +0,0 @@
|
||||
// Filename: chromium.GraphicsStateGuardian.h
|
||||
// Created by: drose (02Feb99)
|
||||
//
|
||||
////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// PANDA 3D SOFTWARE
|
||||
// Copyright (c) 2001 - 2004, Disney Enterprises, Inc. All rights reserved
|
||||
//
|
||||
// All use of this software is subject to the terms of the Panda 3d
|
||||
// Software license. You should have received a copy of this license
|
||||
// along with this source code; you will also find a current copy of
|
||||
// the license at http://etc.cmu.edu/panda3d/docs/license/ .
|
||||
//
|
||||
// To contact the maintainers of this program write to
|
||||
// panda3d-general@lists.sourceforge.net .
|
||||
//
|
||||
////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef CRGRAPHICSSTATEGUARDIAN_H
|
||||
#define CRGRAPHICSSTATEGUARDIAN_H
|
||||
|
||||
//#define GSG_VERBOSE
|
||||
|
||||
#include "pandabase.h"
|
||||
|
||||
#include "graphicsStateGuardian.h"
|
||||
#include "geomprimitives.h"
|
||||
#include "texture.h"
|
||||
#include "pixelBuffer.h"
|
||||
#include "displayRegion.h"
|
||||
#include "material.h"
|
||||
#include "depthTestAttrib.h"
|
||||
#include "textureApplyAttrib.h"
|
||||
#include "pointerToArray.h"
|
||||
|
||||
#ifdef WIN32_VC
|
||||
// Must include windows.h before gl.h on NT
|
||||
#define WIN32_LEAN_AND_MEAN
|
||||
#include <windows.h>
|
||||
#undef WIN32_LEAN_AND_MEAN
|
||||
#endif
|
||||
|
||||
|
||||
#include <GL/gl.h>
|
||||
// Chromium specific
|
||||
#ifdef WIN32_VC // [
|
||||
#define WINDOWS 1
|
||||
#endif //]
|
||||
#include "cr_glwrapper.h"
|
||||
#include "cr_applications.h"
|
||||
#include "cr_spu.h"
|
||||
extern SPUDispatchTable chromium;
|
||||
|
||||
|
||||
|
||||
class PlaneNode;
|
||||
class Light;
|
||||
|
||||
#if !defined(WIN32) && defined(GSG_VERBOSE)
|
||||
ostream &output_cr_enum(ostream &out, GLenum v);
|
||||
INLINE ostream &operator << (ostream &out, GLenum v) {
|
||||
return output_cr_enum(out, v);
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
// Class : CRGraphicsStateGuardian
|
||||
// Description : A GraphicsStateGuardian specialized for rendering
|
||||
// into OpenGL contexts. There should be no GL calls
|
||||
// outside of this object.
|
||||
////////////////////////////////////////////////////////////////////
|
||||
class EXPCL_PANDACR CRGraphicsStateGuardian : public GraphicsStateGuardian {
|
||||
public:
|
||||
CRGraphicsStateGuardian(GraphicsWindow *win);
|
||||
~CRGraphicsStateGuardian();
|
||||
|
||||
virtual void reset();
|
||||
|
||||
virtual void clear(const RenderBuffer &buffer);
|
||||
virtual void clear(const RenderBuffer &buffer, const DisplayRegion* region);
|
||||
|
||||
virtual void prepare_display_region();
|
||||
virtual bool prepare_lens();
|
||||
|
||||
virtual void draw_point(GeomPoint *geom, GeomContext *gc);
|
||||
virtual void draw_line(GeomLine *geom, GeomContext *gc);
|
||||
virtual void draw_linestrip(GeomLinestrip *geom, GeomContext *gc);
|
||||
virtual void draw_sprite(GeomSprite *geom, GeomContext *gc);
|
||||
virtual void draw_polygon(GeomPolygon *geom, GeomContext *gc);
|
||||
virtual void draw_quad(GeomQuad *geom, GeomContext *gc);
|
||||
virtual void draw_tri(GeomTri *geom, GeomContext *gc);
|
||||
virtual void draw_tristrip(GeomTristrip *geom, GeomContext *gc);
|
||||
virtual void draw_trifan(GeomTrifan *geom, GeomContext *gc);
|
||||
virtual void draw_sphere(GeomSphere *geom, GeomContext *gc);
|
||||
|
||||
virtual TextureContext *prepare_texture(Texture *tex);
|
||||
virtual void apply_texture(TextureContext *tc);
|
||||
virtual void release_texture(TextureContext *tc);
|
||||
|
||||
virtual GeomNodeContext *prepare_geom_node(GeomNode *node);
|
||||
virtual void draw_geom_node(GeomNode *node, const RenderState *state,
|
||||
GeomNodeContext *gnc);
|
||||
virtual void release_geom_node(GeomNodeContext *gnc);
|
||||
|
||||
virtual void copy_texture(TextureContext *tc, const DisplayRegion *dr);
|
||||
virtual void copy_texture(TextureContext *tc, const DisplayRegion *dr,
|
||||
const RenderBuffer &rb);
|
||||
|
||||
virtual void texture_to_pixel_buffer(TextureContext *tc, PixelBuffer *pb);
|
||||
virtual void texture_to_pixel_buffer(TextureContext *tc, PixelBuffer *pb,
|
||||
const DisplayRegion *dr);
|
||||
|
||||
virtual void copy_pixel_buffer(PixelBuffer *pb, const DisplayRegion *dr);
|
||||
virtual void copy_pixel_buffer(PixelBuffer *pb, const DisplayRegion *dr,
|
||||
const RenderBuffer &rb);
|
||||
virtual void draw_pixel_buffer(PixelBuffer *pb, const DisplayRegion *dr,
|
||||
const NodeTransitions& na=NodeTransitions());
|
||||
virtual void draw_pixel_buffer(PixelBuffer *pb, const DisplayRegion *dr,
|
||||
const RenderBuffer &rb,
|
||||
const NodeTransitions& na=NodeTransitions());
|
||||
|
||||
virtual void apply_material(const Material *material);
|
||||
void apply_fog(Fog *fog);
|
||||
|
||||
virtual void issue_transform(const TransformState *transform);
|
||||
virtual void issue_tex_matrix(const TexMatrixAttrib *attrib);
|
||||
virtual void issue_texture(const TextureAttrib *attrib);
|
||||
virtual void issue_material(const MaterialAttrib *attrib);
|
||||
virtual void issue_render_mode(const RenderModeAttrib *attrib);
|
||||
virtual void issue_texture_apply(const TextureApplyAttrib *attrib);
|
||||
virtual void issue_color_write(const ColorWriteAttrib *attrib);
|
||||
virtual void issue_depth_test(const DepthTestAttrib *attrib);
|
||||
virtual void issue_depth_write(const DepthWriteAttrib *attrib);
|
||||
virtual void issue_cull_face(const CullFaceAttrib *attrib);
|
||||
virtual void issue_fog(const FogAttrib *attrib);
|
||||
virtual void issue_depth_offset(const DepthOffsetAttrib *attrib);
|
||||
// virtual void issue_tex_gen(const TexGenAttrib *attrib);
|
||||
// virtual void issue_stencil(const StencilAttrib *attrib);
|
||||
// virtual void issue_clip_plane(const ClipPlaneAttrib *attrib);
|
||||
|
||||
virtual void bind_light(PointLight *light, int light_id);
|
||||
virtual void bind_light(DirectionalLight *light, int light_id);
|
||||
virtual void bind_light(Spotlight *light, int light_id);
|
||||
|
||||
virtual bool wants_normals(void) const;
|
||||
virtual bool wants_texcoords(void) const;
|
||||
|
||||
virtual bool depth_offset_decals();
|
||||
|
||||
virtual CoordinateSystem get_internal_coordinate_system() const;
|
||||
virtual float compute_distance_to(const LPoint3f &point) const;
|
||||
|
||||
void print_gfx_visual();
|
||||
|
||||
//For those interested in what the guardian thinks is the current
|
||||
//enabled/disable GL State compared to what GL says it is
|
||||
void dump_state(void);
|
||||
|
||||
//Methods for extracting the current color and alpha transformations
|
||||
INLINE const LMatrix4f &get_current_color_mat() const;
|
||||
INLINE const float &get_current_alpha_offset() const;
|
||||
INLINE const float &get_current_alpha_scale() const;
|
||||
|
||||
void issue_transformed_color(const Colorf &color) const;
|
||||
|
||||
protected:
|
||||
virtual void enable_lighting(bool enable);
|
||||
virtual void set_ambient_light(const Colorf &color);
|
||||
virtual void enable_light(int light_id, bool enable);
|
||||
virtual void begin_bind_lights();
|
||||
virtual void end_bind_lights();
|
||||
|
||||
virtual void set_blend_mode(ColorWriteAttrib::Mode color_write_mode,
|
||||
ColorBlendAttrib::Mode color_blend_mode,
|
||||
TransparencyAttrib::Mode transparency_mode);
|
||||
|
||||
void free_pointers();
|
||||
virtual PT(SavedFrameBuffer) save_frame_buffer(const RenderBuffer &buffer,
|
||||
CPT(DisplayRegion) dr);
|
||||
virtual void restore_frame_buffer(SavedFrameBuffer *frame_buffer);
|
||||
|
||||
INLINE void activate();
|
||||
|
||||
INLINE void call_glClearColor(GLclampf red, GLclampf green, GLclampf blue,
|
||||
GLclampf alpha);
|
||||
INLINE void call_glClearDepth(GLclampd depth);
|
||||
INLINE void call_glClearStencil(GLint s);
|
||||
INLINE void call_glClearAccum(GLclampf red, GLclampf green, GLclampf blue,
|
||||
GLclampf alpha);
|
||||
INLINE void call_glDrawBuffer(GLenum mode);
|
||||
INLINE void call_glReadBuffer(GLenum mode);
|
||||
INLINE void call_glShadeModel(GLenum mode);
|
||||
INLINE void call_glBlendFunc(GLenum sfunc, GLenum dfunc);
|
||||
INLINE void call_glCullFace(GLenum mode);
|
||||
INLINE void call_glScissor(GLint x, GLint y, GLsizei width, GLsizei height);
|
||||
INLINE void call_glViewport(GLint x, GLint y, GLsizei width, GLsizei height);
|
||||
INLINE void call_glLightModelLocal(GLboolean local);
|
||||
INLINE void call_glLightModelTwoSide(GLboolean twoside);
|
||||
INLINE void call_glStencilFunc(GLenum func,GLint refval,GLuint mask);
|
||||
INLINE void call_glStencilOp(GLenum fail,GLenum zfail,GLenum pass);
|
||||
INLINE void call_glClipPlane(GLenum plane, const double equation[4]);
|
||||
INLINE void call_glLineWidth(GLfloat width);
|
||||
INLINE void call_glPointSize(GLfloat size);
|
||||
INLINE void call_glFogMode(GLint mode);
|
||||
INLINE void call_glFogStart(GLfloat start);
|
||||
INLINE void call_glFogEnd(GLfloat end);
|
||||
INLINE void call_glFogDensity(GLfloat density);
|
||||
INLINE void call_glFogColor(const Colorf &color);
|
||||
INLINE void call_glAlphaFunc(GLenum func, GLclampf ref);
|
||||
INLINE void call_glPolygonMode(GLenum mode);
|
||||
|
||||
INLINE void set_pack_alignment(GLint alignment);
|
||||
INLINE void set_unpack_alignment(GLint alignment);
|
||||
|
||||
INLINE void enable_multisample(bool val);
|
||||
INLINE void enable_line_smooth(bool val);
|
||||
INLINE void enable_point_smooth(bool val);
|
||||
INLINE void enable_texturing(bool val);
|
||||
INLINE void enable_scissor(bool val);
|
||||
INLINE void enable_dither(bool val);
|
||||
INLINE void enable_stencil_test(bool val);
|
||||
INLINE void enable_clip_plane(int clip_plane, bool val);
|
||||
INLINE void enable_multisample_alpha_one(bool val);
|
||||
INLINE void enable_multisample_alpha_mask(bool val);
|
||||
INLINE void enable_blend(bool val);
|
||||
INLINE void enable_depth_test(bool val);
|
||||
INLINE void enable_fog(bool val);
|
||||
INLINE void enable_alpha_test(bool val);
|
||||
INLINE void enable_polygon_offset(bool val);
|
||||
|
||||
INLINE GLenum get_light_id(int index) const;
|
||||
INLINE GLenum get_clip_plane_id(int index) const;
|
||||
|
||||
INLINE void issue_scene_graph_color();
|
||||
|
||||
void set_draw_buffer(const RenderBuffer &rb);
|
||||
void set_read_buffer(const RenderBuffer &rb);
|
||||
|
||||
void bind_texture(TextureContext *tc);
|
||||
void specify_texture(Texture *tex);
|
||||
bool apply_texture_immediate(Texture *tex);
|
||||
|
||||
GLenum get_texture_wrap_mode(Texture::WrapMode wm);
|
||||
GLenum get_texture_filter_type(Texture::FilterType ft);
|
||||
GLenum get_image_type(PixelBuffer::Type type);
|
||||
GLenum get_external_image_format(PixelBuffer::Format format);
|
||||
GLenum get_internal_image_format(PixelBuffer::Format format);
|
||||
GLint get_texture_apply_mode_type( TextureApplyProperty::Mode am ) const;
|
||||
GLint get_texture_apply_mode_type(TextureApplyAttrib::Mode am) const;
|
||||
GLenum get_depth_func_type(DepthTestProperty::Mode m) const;
|
||||
GLenum get_depth_func_type(DepthTestAttrib::Mode m) const;
|
||||
GLenum get_stencil_func_type(StencilProperty::Mode m) const;
|
||||
GLenum get_stencil_action_type(StencilProperty::Action a) const;
|
||||
GLenum get_fog_mode_type(Fog::Mode m) const;
|
||||
|
||||
#ifndef NDEBUG
|
||||
void build_phony_mipmaps(Texture *tex);
|
||||
void build_phony_mipmap_level(int level, int xsize, int ysize);
|
||||
void save_mipmap_images(Texture *tex);
|
||||
#endif
|
||||
|
||||
GLclampf _clear_color_red, _clear_color_green, _clear_color_blue,
|
||||
_clear_color_alpha;
|
||||
GLclampd _clear_depth;
|
||||
GLint _clear_stencil;
|
||||
GLclampf _clear_accum_red, _clear_accum_green, _clear_accum_blue,
|
||||
_clear_accum_alpha;
|
||||
GLenum _draw_buffer_mode;
|
||||
GLenum _read_buffer_mode;
|
||||
GLenum _shade_model_mode;
|
||||
GLint _scissor_x;
|
||||
GLint _scissor_y;
|
||||
GLsizei _scissor_width;
|
||||
GLsizei _scissor_height;
|
||||
GLint _viewport_x;
|
||||
GLint _viewport_y;
|
||||
GLsizei _viewport_width;
|
||||
GLsizei _viewport_height;
|
||||
GLboolean _lmodel_local;
|
||||
GLboolean _lmodel_twoside;
|
||||
Colorf _material_ambient;
|
||||
Colorf _material_diffuse;
|
||||
Colorf _material_specular;
|
||||
float _material_shininess;
|
||||
Colorf _material_emission;
|
||||
GLenum _stencil_func;
|
||||
GLenum _stencil_op;
|
||||
GLfloat _line_width;
|
||||
GLfloat _point_size;
|
||||
GLenum _blend_source_func;
|
||||
GLenum _blend_dest_func;
|
||||
GLboolean _depth_mask;
|
||||
GLint _fog_mode;
|
||||
GLfloat _fog_start;
|
||||
GLfloat _fog_end;
|
||||
GLfloat _fog_density;
|
||||
Colorf _fog_color;
|
||||
GLenum _alpha_func;
|
||||
GLclampf _alpha_func_ref;
|
||||
GLenum _polygon_mode;
|
||||
|
||||
GLint _pack_alignment;
|
||||
GLint _unpack_alignment;
|
||||
|
||||
bool _multisample_enabled;
|
||||
bool _line_smooth_enabled;
|
||||
bool _point_smooth_enabled;
|
||||
bool _scissor_enabled;
|
||||
bool _texturing_enabled;
|
||||
bool _dither_enabled;
|
||||
bool _stencil_test_enabled;
|
||||
bool _multisample_alpha_one_enabled;
|
||||
bool _multisample_alpha_mask_enabled;
|
||||
bool _blend_enabled;
|
||||
bool _depth_test_enabled;
|
||||
bool _fog_enabled;
|
||||
bool _dithering_enabled;
|
||||
bool _alpha_test_enabled;
|
||||
bool _polygon_offset_enabled;
|
||||
int _decal_level;
|
||||
|
||||
int _cur_light_id;
|
||||
|
||||
LMatrix4f _current_projection_mat;
|
||||
int _projection_mat_stack_count;
|
||||
|
||||
int _max_clip_planes;
|
||||
PTA(PlaneNode *)_available_clip_plane_ids; // pPlaneNode[_max_clip_planes]
|
||||
bool *_clip_plane_enabled; // bool[_max_clip_planes]
|
||||
bool *_cur_clip_plane_enabled; // bool[_max_clip_planes]
|
||||
int _cur_clip_plane_id;
|
||||
|
||||
CPT(DisplayRegion) _actual_display_region;
|
||||
|
||||
int _pass_number;
|
||||
|
||||
public:
|
||||
static GraphicsStateGuardian *
|
||||
make_GlGraphicsStateGuardian(const FactoryParams ¶ms);
|
||||
|
||||
static TypeHandle get_class_type(void);
|
||||
static void init_type(void);
|
||||
virtual TypeHandle get_type(void) const;
|
||||
virtual TypeHandle force_init_type() {init_type(); return get_class_type();}
|
||||
|
||||
static PStatCollector _vertices_display_list_pcollector;
|
||||
|
||||
private:
|
||||
static TypeHandle _type_handle;
|
||||
};
|
||||
|
||||
#ifdef DO_PSTATS
|
||||
#define DO_PSTATS_STUFF(XX) XX;
|
||||
#else
|
||||
#define DO_PSTATS_STUFF(XX)
|
||||
#endif
|
||||
|
||||
#include "crGraphicsStateGuardian.I"
|
||||
|
||||
#endif
|
||||
|
@ -1,39 +0,0 @@
|
||||
// Filename: chromium.SavedFrameBuffer.I
|
||||
// Created by: drose (06Oct99)
|
||||
//
|
||||
////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// PANDA 3D SOFTWARE
|
||||
// Copyright (c) 2001 - 2004, Disney Enterprises, Inc. All rights reserved
|
||||
//
|
||||
// All use of this software is subject to the terms of the Panda 3d
|
||||
// Software license. You should have received a copy of this license
|
||||
// along with this source code; you will also find a current copy of
|
||||
// the license at http://etc.cmu.edu/panda3d/docs/license/ .
|
||||
//
|
||||
// To contact the maintainers of this program write to
|
||||
// panda3d-general@lists.sourceforge.net .
|
||||
//
|
||||
////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
// Function: CRSavedFrameBuffer::Constructor
|
||||
// Access: Public
|
||||
// Description:
|
||||
////////////////////////////////////////////////////////////////////
|
||||
INLINE CRSavedFrameBuffer::
|
||||
CRSavedFrameBuffer(const RenderBuffer &buffer, CPT(DisplayRegion) dr) :
|
||||
SavedFrameBuffer(buffer, dr)
|
||||
{
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
// Function: CRSavedFrameBuffer::Destructor
|
||||
// Access: Public
|
||||
// Description:
|
||||
////////////////////////////////////////////////////////////////////
|
||||
INLINE CRSavedFrameBuffer::
|
||||
~CRSavedFrameBuffer() {
|
||||
}
|
||||
|
@ -1,21 +0,0 @@
|
||||
// Filename: chromium.SavedFrameBuffer.cxx
|
||||
// Created by: drose (06Oct99)
|
||||
//
|
||||
////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// PANDA 3D SOFTWARE
|
||||
// Copyright (c) 2001 - 2004, Disney Enterprises, Inc. All rights reserved
|
||||
//
|
||||
// All use of this software is subject to the terms of the Panda 3d
|
||||
// Software license. You should have received a copy of this license
|
||||
// along with this source code; you will also find a current copy of
|
||||
// the license at http://etc.cmu.edu/panda3d/docs/license/ .
|
||||
//
|
||||
// To contact the maintainers of this program write to
|
||||
// panda3d-general@lists.sourceforge.net .
|
||||
//
|
||||
////////////////////////////////////////////////////////////////////
|
||||
|
||||
#include "crSavedFrameBuffer.h"
|
||||
|
||||
TypeHandle CRSavedFrameBuffer::_type_handle;
|
@ -1,31 +0,0 @@
|
||||
// Filename: chromium.TextureContext.I
|
||||
// Created by: drose (07Oct99)
|
||||
//
|
||||
////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// PANDA 3D SOFTWARE
|
||||
// Copyright (c) 2001 - 2004, Disney Enterprises, Inc. All rights reserved
|
||||
//
|
||||
// All use of this software is subject to the terms of the Panda 3d
|
||||
// Software license. You should have received a copy of this license
|
||||
// along with this source code; you will also find a current copy of
|
||||
// the license at http://etc.cmu.edu/panda3d/docs/license/ .
|
||||
//
|
||||
// To contact the maintainers of this program write to
|
||||
// panda3d-general@lists.sourceforge.net .
|
||||
//
|
||||
////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
// Function: CRTextureContext::Constructor
|
||||
// Access: Public
|
||||
// Description:
|
||||
////////////////////////////////////////////////////////////////////
|
||||
INLINE CRTextureContext::
|
||||
CRTextureContext(Texture *tex) :
|
||||
TextureContext(tex)
|
||||
{
|
||||
_index = 0;
|
||||
_priority = 0.5; // For keeping resident in texture memory
|
||||
}
|
@ -1,21 +0,0 @@
|
||||
// Filename: chromium.TextureContext.cxx
|
||||
// Created by: drose (07Oct99)
|
||||
//
|
||||
////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// PANDA 3D SOFTWARE
|
||||
// Copyright (c) 2001 - 2004, Disney Enterprises, Inc. All rights reserved
|
||||
//
|
||||
// All use of this software is subject to the terms of the Panda 3d
|
||||
// Software license. You should have received a copy of this license
|
||||
// along with this source code; you will also find a current copy of
|
||||
// the license at http://etc.cmu.edu/panda3d/docs/license/ .
|
||||
//
|
||||
// To contact the maintainers of this program write to
|
||||
// panda3d-general@lists.sourceforge.net .
|
||||
//
|
||||
////////////////////////////////////////////////////////////////////
|
||||
|
||||
#include "crTextureContext.h"
|
||||
|
||||
TypeHandle CRTextureContext::_type_handle;
|
@ -1,79 +0,0 @@
|
||||
// Filename: chromium.TextureContext.h
|
||||
// Created by: drose (07Oct99)
|
||||
//
|
||||
////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// PANDA 3D SOFTWARE
|
||||
// Copyright (c) 2001 - 2004, Disney Enterprises, Inc. All rights reserved
|
||||
//
|
||||
// All use of this software is subject to the terms of the Panda 3d
|
||||
// Software license. You should have received a copy of this license
|
||||
// along with this source code; you will also find a current copy of
|
||||
// the license at http://etc.cmu.edu/panda3d/docs/license/ .
|
||||
//
|
||||
// To contact the maintainers of this program write to
|
||||
// panda3d-general@lists.sourceforge.net .
|
||||
//
|
||||
////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef CRTEXTURECONTEXT_H
|
||||
#define CRTEXTURECONTEXT_H
|
||||
|
||||
#include "pandabase.h"
|
||||
|
||||
#ifdef WIN32_VC
|
||||
// Must include windows.h before gl.h on NT
|
||||
#define WIN32_LEAN_AND_MEAN
|
||||
#include <windows.h>
|
||||
#undef WIN32_LEAN_AND_MEAN
|
||||
#endif
|
||||
|
||||
|
||||
#include <GL/gl.h>
|
||||
// Chromium specific
|
||||
#ifdef WIN32_VC // [
|
||||
#define WINDOWS 1
|
||||
#endif //]
|
||||
#include "cr_glwrapper.h"
|
||||
#include "cr_applications.h"
|
||||
#include "cr_spu.h"
|
||||
extern SPUDispatchTable chromium;
|
||||
|
||||
#include "textureContext.h"
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
// Class : CRTextureContext
|
||||
// Description :
|
||||
////////////////////////////////////////////////////////////////////
|
||||
class EXPCL_PANDACR CRTextureContext : public TextureContext {
|
||||
public:
|
||||
INLINE CRTextureContext(Texture *tex);
|
||||
|
||||
// This is the GL "name" of the texture object.
|
||||
GLuint _index;
|
||||
|
||||
// This is a GL texture priority.
|
||||
GLfloat _priority;
|
||||
|
||||
public:
|
||||
static TypeHandle get_class_type() {
|
||||
return _type_handle;
|
||||
}
|
||||
static void init_type() {
|
||||
TextureContext::init_type();
|
||||
register_type(_type_handle, "CRTextureContext",
|
||||
TextureContext::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;
|
||||
};
|
||||
|
||||
#include "crTextureContext.I"
|
||||
|
||||
#endif
|
||||
|
@ -1,946 +0,0 @@
|
||||
#!python
|
||||
|
||||
import re
|
||||
|
||||
files=(
|
||||
"config_%(n)sgsg.cxx",
|
||||
"config_%(n)sgsg.h",
|
||||
"%(n)sGeomNodeContext.I",
|
||||
"%(n)sGeomNodeContext.cxx",
|
||||
"%(n)sGeomNodeContext.h",
|
||||
"%(n)sGraphicsStateGuardian.I",
|
||||
"%(n)sGraphicsStateGuardian.cxx",
|
||||
"%(n)sGraphicsStateGuardian.h",
|
||||
"%(n)sSavedFrameBuffer.I",
|
||||
"%(n)sSavedFrameBuffer.cxx",
|
||||
"%(n)sSavedFrameBuffer.h",
|
||||
"%(n)sTextureContext.I",
|
||||
"%(n)sTextureContext.cxx",
|
||||
"%(n)sTextureContext.h",
|
||||
"%(n)sext.h",
|
||||
"%(n)sgsg_composite1.cxx",
|
||||
#"Sources.pp",
|
||||
)
|
||||
|
||||
conversion=(
|
||||
("\"gl([A-Z])", "\"cr\\1"),
|
||||
("\\bgl([A-Z])", "chromium.\\1"),
|
||||
("\\bGL([A-TV-Z])", "CR\\1"),
|
||||
("glgsg", "crgsg"),
|
||||
("gl_", "cr_"),
|
||||
("gl-", "cr-"),
|
||||
#("GL_", "CR_"),
|
||||
("PANDAGL", "PANDACR"),
|
||||
("#include <GL/gl.h>", """
|
||||
#include <GL/gl.h>
|
||||
// Chromium specific
|
||||
#ifdef WIN32_VC // [
|
||||
#define WINDOWS 1
|
||||
#endif //]
|
||||
#include "cr_glwrapper.h"
|
||||
#include "cr_applications.h"
|
||||
#include "cr_spu.h"
|
||||
extern SPUDispatchTable chromium;
|
||||
"""),
|
||||
("(TypeHandle CRGraphicsStateGuardian::_type_handle;)", "\\1\nSPUDispatchTable chromium;"),
|
||||
)
|
||||
|
||||
for fn in files:
|
||||
destPath=fn%({"n":"cr"})
|
||||
print destPath
|
||||
# Read the file:
|
||||
f=open("../glgsg/"+(fn)%({"n":"gl"}), "rb")
|
||||
text=f.read()
|
||||
f.close()
|
||||
|
||||
# Convert the text:
|
||||
for i in conversion:
|
||||
text=re.sub(i[0], i[1], text)
|
||||
|
||||
# Write the file:
|
||||
dest=open(destPath, "wb")
|
||||
dest.write(text)
|
||||
dest.close()
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
"""
|
||||
("\\bglAccum", "chromium.Accum"),
|
||||
("\\bglActiveTextureARB", "chromium.ActiveTextureARB"),
|
||||
("\\bglAlphaFunc", "chromium.AlphaFunc"),
|
||||
("\\bglAreTexturesResident", "chromium.AreTexturesResident"),
|
||||
("\\bglArrayElement", "chromium.ArrayElement"),
|
||||
("\\bglBarrierCreate", "chromium.BarrierCreate"),
|
||||
("\\bglBarrierDestroy", "chromium.BarrierDestroy"),
|
||||
("\\bglBarrierExec", "chromium.BarrierExec"),
|
||||
("\\bglBegin", "chromium.Begin"),
|
||||
("\\bglBindTexture", "chromium.BindTexture"),
|
||||
("\\bglBitmap", "chromium.Bitmap"),
|
||||
("\\bglBlendColorEXT", "chromium.BlendColorEXT"),
|
||||
("\\bglBlendEquationEXT", "chromium.BlendEquationEXT"),
|
||||
("\\bglBlendFunc", "chromium.BlendFunc"),
|
||||
("\\bglBoundsInfo", "chromium.BoundsInfo"),
|
||||
("\\bglCallList", "chromium.CallList"),
|
||||
("\\bglCallLists", "chromium.CallLists"),
|
||||
("\\bglChromiumParameterfCR", "chromium.ChromiumParameterfCR"),
|
||||
("\\bglChromiumParameteriCR", "chromium.ChromiumParameteriCR"),
|
||||
("\\bglChromiumParametervCR", "chromium.ChromiumParametervCR"),
|
||||
("\\bglClear", "chromium.Clear"),
|
||||
("\\bglClearAccum", "chromium.ClearAccum"),
|
||||
("\\bglClearColor", "chromium.ClearColor"),
|
||||
("\\bglClearDepth", "chromium.ClearDepth"),
|
||||
("\\bglClearIndex", "chromium.ClearIndex"),
|
||||
("\\bglClearStencil", "chromium.ClearStencil"),
|
||||
("\\bglClientActiveTextureARB", "chromium.ClientActiveTextureARB"),
|
||||
("\\bglClipPlane", "chromium.ClipPlane"),
|
||||
("\\bglColor3b", "chromium.Color3b"),
|
||||
("\\bglColor3bv", "chromium.Color3bv"),
|
||||
("\\bglColor3d", "chromium.Color3d"),
|
||||
("\\bglColor3dv", "chromium.Color3dv"),
|
||||
("\\bglColor3f", "chromium.Color3f"),
|
||||
("\\bglColor3fv", "chromium.Color3fv"),
|
||||
("\\bglColor3i", "chromium.Color3i"),
|
||||
("\\bglColor3iv", "chromium.Color3iv"),
|
||||
("\\bglColor3s", "chromium.Color3s"),
|
||||
("\\bglColor3sv", "chromium.Color3sv"),
|
||||
("\\bglColor3ub", "chromium.Color3ub"),
|
||||
("\\bglColor3ubv", "chromium.Color3ubv"),
|
||||
("\\bglColor3ui", "chromium.Color3ui"),
|
||||
("\\bglColor3uiv", "chromium.Color3uiv"),
|
||||
("\\bglColor3us", "chromium.Color3us"),
|
||||
("\\bglColor3usv", "chromium.Color3usv"),
|
||||
("\\bglColor4b", "chromium.Color4b"),
|
||||
("\\bglColor4bv", "chromium.Color4bv"),
|
||||
("\\bglColor4d", "chromium.Color4d"),
|
||||
("\\bglColor4dv", "chromium.Color4dv"),
|
||||
("\\bglColor4f", "chromium.Color4f"),
|
||||
("\\bglColor4fv", "chromium.Color4fv"),
|
||||
("\\bglColor4i", "chromium.Color4i"),
|
||||
("\\bglColor4iv", "chromium.Color4iv"),
|
||||
("\\bglColor4s", "chromium.Color4s"),
|
||||
("\\bglColor4sv", "chromium.Color4sv"),
|
||||
("\\bglColor4ub", "chromium.Color4ub"),
|
||||
("\\bglColor4ubv", "chromium.Color4ubv"),
|
||||
("\\bglColor4ui", "chromium.Color4ui"),
|
||||
("\\bglColor4uiv", "chromium.Color4uiv"),
|
||||
("\\bglColor4us", "chromium.Color4us"),
|
||||
("\\bglColor4usv", "chromium.Color4usv"),
|
||||
("\\bglColorMask", "chromium.ColorMask"),
|
||||
("\\bglColorMaterial", "chromium.ColorMaterial"),
|
||||
("\\bglColorPointer", "chromium.ColorPointer"),
|
||||
("\\bglCombinerInputNV", "chromium.CombinerInputNV"),
|
||||
("\\bglCombinerOutputNV", "chromium.CombinerOutputNV"),
|
||||
("\\bglCombinerParameterfNV", "chromium.CombinerParameterfNV"),
|
||||
("\\bglCombinerParameterfvNV", "chromium.CombinerParameterfvNV"),
|
||||
("\\bglCombinerParameteriNV", "chromium.CombinerParameteriNV"),
|
||||
("\\bglCombinerParameterivNV", "chromium.CombinerParameterivNV"),
|
||||
("\\bglCombinerStageParameterfvNV", "chromium.CombinerStageParameterfvNV"),
|
||||
("\\bglCopyPixels", "chromium.CopyPixels"),
|
||||
("\\bglCopyTexImage1D", "chromium.CopyTexImage1D"),
|
||||
("\\bglCopyTexImage2D", "chromium.CopyTexImage2D"),
|
||||
("\\bglCopyTexSubImage1D", "chromium.CopyTexSubImage1D"),
|
||||
("\\bglCopyTexSubImage2D", "chromium.CopyTexSubImage2D"),
|
||||
("\\bglCreateContext", "chromium.CreateContext"),
|
||||
("\\bglCullFace", "chromium.CullFace"),
|
||||
("\\bglDeleteLists", "chromium.DeleteLists"),
|
||||
("\\bglDeleteTextures", "chromium.DeleteTextures"),
|
||||
("\\bglDepthFunc", "chromium.DepthFunc"),
|
||||
("\\bglDepthMask", "chromium.DepthMask"),
|
||||
("\\bglDepthRange", "chromium.DepthRange"),
|
||||
("\\bglDestroyContext", "chromium.DestroyContext"),
|
||||
("\\bglDisable", "chromium.Disable"),
|
||||
("\\bglDisableClientState", "chromium.DisableClientState"),
|
||||
("\\bglDrawArrays", "chromium.DrawArrays"),
|
||||
("\\bglDrawBuffer", "chromium.DrawBuffer"),
|
||||
("\\bglDrawElements", "chromium.DrawElements"),
|
||||
("\\bglDrawPixels", "chromium.DrawPixels"),
|
||||
("\\bglDrawRangeElements", "chromium.DrawRangeElements"),
|
||||
("\\bglEdgeFlag", "chromium.EdgeFlag"),
|
||||
("\\bglEdgeFlagPointer", "chromium.EdgeFlagPointer"),
|
||||
("\\bglEdgeFlagv", "chromium.EdgeFlagv"),
|
||||
("\\bglEnable", "chromium.Enable"),
|
||||
("\\bglEnableClientState", "chromium.EnableClientState"),
|
||||
("\\bglEnd", "chromium.End"),
|
||||
("\\bglEndList", "chromium.EndList"),
|
||||
("\\bglEvalCoord1d", "chromium.EvalCoord1d"),
|
||||
("\\bglEvalCoord1dv", "chromium.EvalCoord1dv"),
|
||||
("\\bglEvalCoord1f", "chromium.EvalCoord1f"),
|
||||
("\\bglEvalCoord1fv", "chromium.EvalCoord1fv"),
|
||||
("\\bglEvalCoord2d", "chromium.EvalCoord2d"),
|
||||
("\\bglEvalCoord2dv", "chromium.EvalCoord2dv"),
|
||||
("\\bglEvalCoord2f", "chromium.EvalCoord2f"),
|
||||
("\\bglEvalCoord2fv", "chromium.EvalCoord2fv"),
|
||||
("\\bglEvalMesh1", "chromium.EvalMesh1"),
|
||||
("\\bglEvalMesh2", "chromium.EvalMesh2"),
|
||||
("\\bglEvalPoint1", "chromium.EvalPoint1"),
|
||||
("\\bglEvalPoint2", "chromium.EvalPoint2"),
|
||||
("\\bglFeedbackBuffer", "chromium.FeedbackBuffer"),
|
||||
("\\bglFinalCombinerInputNV", "chromium.FinalCombinerInputNV"),
|
||||
("\\bglFinish", "chromium.Finish"),
|
||||
("\\bglFlush", "chromium.Flush"),
|
||||
("\\bglFogf", "chromium.Fogf"),
|
||||
("\\bglFogfv", "chromium.Fogfv"),
|
||||
("\\bglFogi", "chromium.Fogi"),
|
||||
("\\bglFogiv", "chromium.Fogiv"),
|
||||
("\\bglFrontFace", "chromium.FrontFace"),
|
||||
("\\bglFrustum", "chromium.Frustum"),
|
||||
("\\bglGenLists", "chromium.GenLists"),
|
||||
("\\bglGenTextures", "chromium.GenTextures"),
|
||||
("\\bglGetBooleanv", "chromium.GetBooleanv"),
|
||||
("\\bglGetChromiumParametervCR", "chromium.GetChromiumParametervCR"),
|
||||
("\\bglGetClipPlane", "chromium.GetClipPlane"),
|
||||
("\\bglGetCombinerInputParameterfvNV", "chromium.GetCombinerInputParameterfvNV"),
|
||||
("\\bglGetCombinerInputParameterivNV", "chromium.GetCombinerInputParameterivNV"),
|
||||
("\\bglGetCombinerOutputParameterfvNV", "chromium.GetCombinerOutputParameterfvNV"),
|
||||
("\\bglGetCombinerOutputParameterivNV", "chromium.GetCombinerOutputParameterivNV"),
|
||||
("\\bglGetCombinerStageParameterfvNV", "chromium.GetCombinerStageParameterfvNV"),
|
||||
("\\bglGetDoublev", "chromium.GetDoublev"),
|
||||
("\\bglGetError", "chromium.GetError"),
|
||||
("\\bglGetFinalCombinerInputParameterfvNV", "chromium.GetFinalCombinerInputParameterfvNV"),
|
||||
("\\bglGetFinalCombinerInputParameterivNV", "chromium.GetFinalCombinerInputParameterivNV"),
|
||||
("\\bglGetFloatv", "chromium.GetFloatv"),
|
||||
("\\bglGetIntegerv", "chromium.GetIntegerv"),
|
||||
("\\bglGetLightfv", "chromium.GetLightfv"),
|
||||
("\\bglGetLightiv", "chromium.GetLightiv"),
|
||||
("\\bglGetMapdv", "chromium.GetMapdv"),
|
||||
("\\bglGetMapfv", "chromium.GetMapfv"),
|
||||
("\\bglGetMapiv", "chromium.GetMapiv"),
|
||||
("\\bglGetMaterialfv", "chromium.GetMaterialfv"),
|
||||
("\\bglGetMaterialiv", "chromium.GetMaterialiv"),
|
||||
("\\bglGetPixelMapfv", "chromium.GetPixelMapfv"),
|
||||
("\\bglGetPixelMapuiv", "chromium.GetPixelMapuiv"),
|
||||
("\\bglGetPixelMapusv", "chromium.GetPixelMapusv"),
|
||||
("\\bglGetPointerv", "chromium.GetPointerv"),
|
||||
("\\bglGetPolygonStipple", "chromium.GetPolygonStipple"),
|
||||
("\\bglGetString", "chromium.GetString"),
|
||||
("\\bglGetTexEnvfv", "chromium.GetTexEnvfv"),
|
||||
("\\bglGetTexEnviv", "chromium.GetTexEnviv"),
|
||||
("\\bglGetTexGendv", "chromium.GetTexGendv"),
|
||||
("\\bglGetTexGenfv", "chromium.GetTexGenfv"),
|
||||
("\\bglGetTexGeniv", "chromium.GetTexGeniv"),
|
||||
("\\bglGetTexImage", "chromium.GetTexImage"),
|
||||
("\\bglGetTexLevelParameterfv", "chromium.GetTexLevelParameterfv"),
|
||||
("\\bglGetTexLevelParameteriv", "chromium.GetTexLevelParameteriv"),
|
||||
("\\bglGetTexParameterfv", "chromium.GetTexParameterfv"),
|
||||
("\\bglGetTexParameteriv", "chromium.GetTexParameteriv"),
|
||||
("\\bglHint", "chromium.Hint"),
|
||||
("\\bglIndexMask", "chromium.IndexMask"),
|
||||
("\\bglIndexPointer", "chromium.IndexPointer"),
|
||||
("\\bglIndexd", "chromium.Indexd"),
|
||||
("\\bglIndexdv", "chromium.Indexdv"),
|
||||
("\\bglIndexf", "chromium.Indexf"),
|
||||
("\\bglIndexfv", "chromium.Indexfv"),
|
||||
("\\bglIndexi", "chromium.Indexi"),
|
||||
("\\bglIndexiv", "chromium.Indexiv"),
|
||||
("\\bglIndexs", "chromium.Indexs"),
|
||||
("\\bglIndexsv", "chromium.Indexsv"),
|
||||
("\\bglIndexub", "chromium.Indexub"),
|
||||
("\\bglIndexubv", "chromium.Indexubv"),
|
||||
("\\bglInitNames", "chromium.InitNames"),
|
||||
("\\bglInterleavedArrays", "chromium.InterleavedArrays"),
|
||||
("\\bglIsEnabled", "chromium.IsEnabled"),
|
||||
("\\bglIsList", "chromium.IsList"),
|
||||
("\\bglIsTexture", "chromium.IsTexture"),
|
||||
("\\bglLightModelf", "chromium.LightModelf"),
|
||||
("\\bglLightModelfv", "chromium.LightModelfv"),
|
||||
("\\bglLightModeli", "chromium.LightModeli"),
|
||||
("\\bglLightModeliv", "chromium.LightModeliv"),
|
||||
("\\bglLightf", "chromium.Lightf"),
|
||||
("\\bglLightfv", "chromium.Lightfv"),
|
||||
("\\bglLighti", "chromium.Lighti"),
|
||||
("\\bglLightiv", "chromium.Lightiv"),
|
||||
("\\bglLineStipple", "chromium.LineStipple"),
|
||||
("\\bglLineWidth", "chromium.LineWidth"),
|
||||
("\\bglListBase", "chromium.ListBase"),
|
||||
("\\bglLoadIdentity", "chromium.LoadIdentity"),
|
||||
("\\bglLoadMatrixd", "chromium.LoadMatrixd"),
|
||||
("\\bglLoadMatrixf", "chromium.LoadMatrixf"),
|
||||
("\\bglLoadName", "chromium.LoadName"),
|
||||
("\\bglLogicOp", "chromium.LogicOp"),
|
||||
("\\bglMakeCurrent", "chromium.MakeCurrent"),
|
||||
("\\bglMap1d", "chromium.Map1d"),
|
||||
("\\bglMap1f", "chromium.Map1f"),
|
||||
("\\bglMap2d", "chromium.Map2d"),
|
||||
("\\bglMap2f", "chromium.Map2f"),
|
||||
("\\bglMapGrid1d", "chromium.MapGrid1d"),
|
||||
("\\bglMapGrid1f", "chromium.MapGrid1f"),
|
||||
("\\bglMapGrid2d", "chromium.MapGrid2d"),
|
||||
("\\bglMapGrid2f", "chromium.MapGrid2f"),
|
||||
("\\bglMaterialf", "chromium.Materialf"),
|
||||
("\\bglMaterialfv", "chromium.Materialfv"),
|
||||
("\\bglMateriali", "chromium.Materiali"),
|
||||
("\\bglMaterialiv", "chromium.Materialiv"),
|
||||
("\\bglMatrixMode", "chromium.MatrixMode"),
|
||||
("\\bglMultMatrixd", "chromium.MultMatrixd"),
|
||||
("\\bglMultMatrixf", "chromium.MultMatrixf"),
|
||||
("\\bglMultiTexCoord1dARB", "chromium.MultiTexCoord1dARB"),
|
||||
("\\bglMultiTexCoord1dvARB", "chromium.MultiTexCoord1dvARB"),
|
||||
("\\bglMultiTexCoord1fARB", "chromium.MultiTexCoord1fARB"),
|
||||
("\\bglMultiTexCoord1fvARB", "chromium.MultiTexCoord1fvARB"),
|
||||
("\\bglMultiTexCoord1iARB", "chromium.MultiTexCoord1iARB"),
|
||||
("\\bglMultiTexCoord1ivARB", "chromium.MultiTexCoord1ivARB"),
|
||||
("\\bglMultiTexCoord1sARB", "chromium.MultiTexCoord1sARB"),
|
||||
("\\bglMultiTexCoord1svARB", "chromium.MultiTexCoord1svARB"),
|
||||
("\\bglMultiTexCoord2dARB", "chromium.MultiTexCoord2dARB"),
|
||||
("\\bglMultiTexCoord2dvARB", "chromium.MultiTexCoord2dvARB"),
|
||||
("\\bglMultiTexCoord2fARB", "chromium.MultiTexCoord2fARB"),
|
||||
("\\bglMultiTexCoord2fvARB", "chromium.MultiTexCoord2fvARB"),
|
||||
("\\bglMultiTexCoord2iARB", "chromium.MultiTexCoord2iARB"),
|
||||
("\\bglMultiTexCoord2ivARB", "chromium.MultiTexCoord2ivARB"),
|
||||
("\\bglMultiTexCoord2sARB", "chromium.MultiTexCoord2sARB"),
|
||||
("\\bglMultiTexCoord2svARB", "chromium.MultiTexCoord2svARB"),
|
||||
("\\bglMultiTexCoord3dARB", "chromium.MultiTexCoord3dARB"),
|
||||
("\\bglMultiTexCoord3dvARB", "chromium.MultiTexCoord3dvARB"),
|
||||
("\\bglMultiTexCoord3fARB", "chromium.MultiTexCoord3fARB"),
|
||||
("\\bglMultiTexCoord3fvARB", "chromium.MultiTexCoord3fvARB"),
|
||||
("\\bglMultiTexCoord3iARB", "chromium.MultiTexCoord3iARB"),
|
||||
("\\bglMultiTexCoord3ivARB", "chromium.MultiTexCoord3ivARB"),
|
||||
("\\bglMultiTexCoord3sARB", "chromium.MultiTexCoord3sARB"),
|
||||
("\\bglMultiTexCoord3svARB", "chromium.MultiTexCoord3svARB"),
|
||||
("\\bglMultiTexCoord4dARB", "chromium.MultiTexCoord4dARB"),
|
||||
("\\bglMultiTexCoord4dvARB", "chromium.MultiTexCoord4dvARB"),
|
||||
("\\bglMultiTexCoord4fARB", "chromium.MultiTexCoord4fARB"),
|
||||
("\\bglMultiTexCoord4fvARB", "chromium.MultiTexCoord4fvARB"),
|
||||
("\\bglMultiTexCoord4iARB", "chromium.MultiTexCoord4iARB"),
|
||||
("\\bglMultiTexCoord4ivARB", "chromium.MultiTexCoord4ivARB"),
|
||||
("\\bglMultiTexCoord4sARB", "chromium.MultiTexCoord4sARB"),
|
||||
("\\bglMultiTexCoord4svARB", "chromium.MultiTexCoord4svARB"),
|
||||
("\\bglNewList", "chromium.NewList"),
|
||||
("\\bglNormal3b", "chromium.Normal3b"),
|
||||
("\\bglNormal3bv", "chromium.Normal3bv"),
|
||||
("\\bglNormal3d", "chromium.Normal3d"),
|
||||
("\\bglNormal3dv", "chromium.Normal3dv"),
|
||||
("\\bglNormal3f", "chromium.Normal3f"),
|
||||
("\\bglNormal3fv", "chromium.Normal3fv"),
|
||||
("\\bglNormal3i", "chromium.Normal3i"),
|
||||
("\\bglNormal3iv", "chromium.Normal3iv"),
|
||||
("\\bglNormal3s", "chromium.Normal3s"),
|
||||
("\\bglNormal3sv", "chromium.Normal3sv"),
|
||||
("\\bglNormalPointer", "chromium.NormalPointer"),
|
||||
("\\bglOrtho", "chromium.Ortho"),
|
||||
("\\bglPassThrough", "chromium.PassThrough"),
|
||||
("\\bglPixelMapfv", "chromium.PixelMapfv"),
|
||||
("\\bglPixelMapuiv", "chromium.PixelMapuiv"),
|
||||
("\\bglPixelMapusv", "chromium.PixelMapusv"),
|
||||
("\\bglPixelStoref", "chromium.PixelStoref"),
|
||||
("\\bglPixelStorei", "chromium.PixelStorei"),
|
||||
("\\bglPixelTransferf", "chromium.PixelTransferf"),
|
||||
("\\bglPixelTransferi", "chromium.PixelTransferi"),
|
||||
("\\bglPixelZoom", "chromium.PixelZoom"),
|
||||
("\\bglPointSize", "chromium.PointSize"),
|
||||
("\\bglPolygonMode", "chromium.PolygonMode"),
|
||||
("\\bglPolygonOffset", "chromium.PolygonOffset"),
|
||||
("\\bglPolygonStipple", "chromium.PolygonStipple"),
|
||||
("\\bglPopAttrib", "chromium.PopAttrib"),
|
||||
("\\bglPopClientAttrib", "chromium.PopClientAttrib"),
|
||||
("\\bglPopMatrix", "chromium.PopMatrix"),
|
||||
("\\bglPopName", "chromium.PopName"),
|
||||
("\\bglPrioritizeTextures", "chromium.PrioritizeTextures"),
|
||||
("\\bglPushAttrib", "chromium.PushAttrib"),
|
||||
("\\bglPushClientAttrib", "chromium.PushClientAttrib"),
|
||||
("\\bglPushMatrix", "chromium.PushMatrix"),
|
||||
("\\bglPushName", "chromium.PushName"),
|
||||
("\\bglRasterPos2d", "chromium.RasterPos2d"),
|
||||
("\\bglRasterPos2dv", "chromium.RasterPos2dv"),
|
||||
("\\bglRasterPos2f", "chromium.RasterPos2f"),
|
||||
("\\bglRasterPos2fv", "chromium.RasterPos2fv"),
|
||||
("\\bglRasterPos2i", "chromium.RasterPos2i"),
|
||||
("\\bglRasterPos2iv", "chromium.RasterPos2iv"),
|
||||
("\\bglRasterPos2s", "chromium.RasterPos2s"),
|
||||
("\\bglRasterPos2sv", "chromium.RasterPos2sv"),
|
||||
("\\bglRasterPos3d", "chromium.RasterPos3d"),
|
||||
("\\bglRasterPos3dv", "chromium.RasterPos3dv"),
|
||||
("\\bglRasterPos3f", "chromium.RasterPos3f"),
|
||||
("\\bglRasterPos3fv", "chromium.RasterPos3fv"),
|
||||
("\\bglRasterPos3i", "chromium.RasterPos3i"),
|
||||
("\\bglRasterPos3iv", "chromium.RasterPos3iv"),
|
||||
("\\bglRasterPos3s", "chromium.RasterPos3s"),
|
||||
("\\bglRasterPos3sv", "chromium.RasterPos3sv"),
|
||||
("\\bglRasterPos4d", "chromium.RasterPos4d"),
|
||||
("\\bglRasterPos4dv", "chromium.RasterPos4dv"),
|
||||
("\\bglRasterPos4f", "chromium.RasterPos4f"),
|
||||
("\\bglRasterPos4fv", "chromium.RasterPos4fv"),
|
||||
("\\bglRasterPos4i", "chromium.RasterPos4i"),
|
||||
("\\bglRasterPos4iv", "chromium.RasterPos4iv"),
|
||||
("\\bglRasterPos4s", "chromium.RasterPos4s"),
|
||||
("\\bglRasterPos4sv", "chromium.RasterPos4sv"),
|
||||
("\\bglReadBuffer", "chromium.ReadBuffer"),
|
||||
("\\bglReadPixels", "chromium.ReadPixels"),
|
||||
("\\bglRectd", "chromium.Rectd"),
|
||||
("\\bglRectdv", "chromium.Rectdv"),
|
||||
("\\bglRectf", "chromium.Rectf"),
|
||||
("\\bglRectfv", "chromium.Rectfv"),
|
||||
("\\bglRecti", "chromium.Recti"),
|
||||
("\\bglRectiv", "chromium.Rectiv"),
|
||||
("\\bglRects", "chromium.Rects"),
|
||||
("\\bglRectsv", "chromium.Rectsv"),
|
||||
("\\bglRenderMode", "chromium.RenderMode"),
|
||||
("\\bglRotated", "chromium.Rotated"),
|
||||
("\\bglRotatef", "chromium.Rotatef"),
|
||||
("\\bglScaled", "chromium.Scaled"),
|
||||
("\\bglScalef", "chromium.Scalef"),
|
||||
("\\bglScissor", "chromium.Scissor"),
|
||||
("\\bglSecondaryColor3bEXT", "chromium.SecondaryColor3bEXT"),
|
||||
("\\bglSecondaryColor3bvEXT", "chromium.SecondaryColor3bvEXT"),
|
||||
("\\bglSecondaryColor3dEXT", "chromium.SecondaryColor3dEXT"),
|
||||
("\\bglSecondaryColor3dvEXT", "chromium.SecondaryColor3dvEXT"),
|
||||
("\\bglSecondaryColor3fEXT", "chromium.SecondaryColor3fEXT"),
|
||||
("\\bglSecondaryColor3fvEXT", "chromium.SecondaryColor3fvEXT"),
|
||||
("\\bglSecondaryColor3iEXT", "chromium.SecondaryColor3iEXT"),
|
||||
("\\bglSecondaryColor3ivEXT", "chromium.SecondaryColor3ivEXT"),
|
||||
("\\bglSecondaryColor3sEXT", "chromium.SecondaryColor3sEXT"),
|
||||
("\\bglSecondaryColor3svEXT", "chromium.SecondaryColor3svEXT"),
|
||||
("\\bglSecondaryColor3ubEXT", "chromium.SecondaryColor3ubEXT"),
|
||||
("\\bglSecondaryColor3ubvEXT", "chromium.SecondaryColor3ubvEXT"),
|
||||
("\\bglSecondaryColor3uiEXT", "chromium.SecondaryColor3uiEXT"),
|
||||
("\\bglSecondaryColor3uivEXT", "chromium.SecondaryColor3uivEXT"),
|
||||
("\\bglSecondaryColor3usEXT", "chromium.SecondaryColor3usEXT"),
|
||||
("\\bglSecondaryColor3usvEXT", "chromium.SecondaryColor3usvEXT"),
|
||||
("\\bglSecondaryColorPointerEXT", "chromium.SecondaryColorPointerEXT"),
|
||||
("\\bglSelectBuffer", "chromium.SelectBuffer"),
|
||||
("\\bglSemaphoreCreate", "chromium.SemaphoreCreate"),
|
||||
("\\bglSemaphoreDestroy", "chromium.SemaphoreDestroy"),
|
||||
("\\bglSemaphoreP", "chromium.SemaphoreP"),
|
||||
("\\bglSemaphoreV", "chromium.SemaphoreV"),
|
||||
("\\bglShadeModel", "chromium.ShadeModel"),
|
||||
("\\bglStencilFunc", "chromium.StencilFunc"),
|
||||
("\\bglStencilMask", "chromium.StencilMask"),
|
||||
("\\bglStencilOp", "chromium.StencilOp"),
|
||||
("\\bglSwapBuffers", "chromium.SwapBuffers"),
|
||||
("\\bglTexCoord1d", "chromium.TexCoord1d"),
|
||||
("\\bglTexCoord1dv", "chromium.TexCoord1dv"),
|
||||
("\\bglTexCoord1f", "chromium.TexCoord1f"),
|
||||
("\\bglTexCoord1fv", "chromium.TexCoord1fv"),
|
||||
("\\bglTexCoord1i", "chromium.TexCoord1i"),
|
||||
("\\bglTexCoord1iv", "chromium.TexCoord1iv"),
|
||||
("\\bglTexCoord1s", "chromium.TexCoord1s"),
|
||||
("\\bglTexCoord1sv", "chromium.TexCoord1sv"),
|
||||
("\\bglTexCoord2d", "chromium.TexCoord2d"),
|
||||
("\\bglTexCoord2dv", "chromium.TexCoord2dv"),
|
||||
("\\bglTexCoord2f", "chromium.TexCoord2f"),
|
||||
("\\bglTexCoord2fv", "chromium.TexCoord2fv"),
|
||||
("\\bglTexCoord2i", "chromium.TexCoord2i"),
|
||||
("\\bglTexCoord2iv", "chromium.TexCoord2iv"),
|
||||
("\\bglTexCoord2s", "chromium.TexCoord2s"),
|
||||
("\\bglTexCoord2sv", "chromium.TexCoord2sv"),
|
||||
("\\bglTexCoord3d", "chromium.TexCoord3d"),
|
||||
("\\bglTexCoord3dv", "chromium.TexCoord3dv"),
|
||||
("\\bglTexCoord3f", "chromium.TexCoord3f"),
|
||||
("\\bglTexCoord3fv", "chromium.TexCoord3fv"),
|
||||
("\\bglTexCoord3i", "chromium.TexCoord3i"),
|
||||
("\\bglTexCoord3iv", "chromium.TexCoord3iv"),
|
||||
("\\bglTexCoord3s", "chromium.TexCoord3s"),
|
||||
("\\bglTexCoord3sv", "chromium.TexCoord3sv"),
|
||||
("\\bglTexCoord4d", "chromium.TexCoord4d"),
|
||||
("\\bglTexCoord4dv", "chromium.TexCoord4dv"),
|
||||
("\\bglTexCoord4f", "chromium.TexCoord4f"),
|
||||
("\\bglTexCoord4fv", "chromium.TexCoord4fv"),
|
||||
("\\bglTexCoord4i", "chromium.TexCoord4i"),
|
||||
("\\bglTexCoord4iv", "chromium.TexCoord4iv"),
|
||||
("\\bglTexCoord4s", "chromium.TexCoord4s"),
|
||||
("\\bglTexCoord4sv", "chromium.TexCoord4sv"),
|
||||
("\\bglTexCoordPointer", "chromium.TexCoordPointer"),
|
||||
("\\bglTexEnvf", "chromium.TexEnvf"),
|
||||
("\\bglTexEnvfv", "chromium.TexEnvfv"),
|
||||
("\\bglTexEnvi", "chromium.TexEnvi"),
|
||||
("\\bglTexEnviv", "chromium.TexEnviv"),
|
||||
("\\bglTexGend", "chromium.TexGend"),
|
||||
("\\bglTexGendv", "chromium.TexGendv"),
|
||||
("\\bglTexGenf", "chromium.TexGenf"),
|
||||
("\\bglTexGenfv", "chromium.TexGenfv"),
|
||||
("\\bglTexGeni", "chromium.TexGeni"),
|
||||
("\\bglTexGeniv", "chromium.TexGeniv"),
|
||||
("\\bglTexImage1D", "chromium.TexImage1D"),
|
||||
("\\bglTexImage2D", "chromium.TexImage2D"),
|
||||
("\\bglTexParameterf", "chromium.TexParameterf"),
|
||||
("\\bglTexParameterfv", "chromium.TexParameterfv"),
|
||||
("\\bglTexParameteri", "chromium.TexParameteri"),
|
||||
("\\bglTexParameteriv", "chromium.TexParameteriv"),
|
||||
("\\bglTexSubImage1D", "chromium.TexSubImage1D"),
|
||||
("\\bglTexSubImage2D", "chromium.TexSubImage2D"),
|
||||
("\\bglTranslated", "chromium.Translated"),
|
||||
("\\bglTranslatef", "chromium.Translatef"),
|
||||
("\\bglVertex2d", "chromium.Vertex2d"),
|
||||
("\\bglVertex2dv", "chromium.Vertex2dv"),
|
||||
("\\bglVertex2f", "chromium.Vertex2f"),
|
||||
("\\bglVertex2fv", "chromium.Vertex2fv"),
|
||||
("\\bglVertex2i", "chromium.Vertex2i"),
|
||||
("\\bglVertex2iv", "chromium.Vertex2iv"),
|
||||
("\\bglVertex2s", "chromium.Vertex2s"),
|
||||
("\\bglVertex2sv", "chromium.Vertex2sv"),
|
||||
("\\bglVertex3d", "chromium.Vertex3d"),
|
||||
("\\bglVertex3dv", "chromium.Vertex3dv"),
|
||||
("\\bglVertex3f", "chromium.Vertex3f"),
|
||||
("\\bglVertex3fv", "chromium.Vertex3fv"),
|
||||
("\\bglVertex3i", "chromium.Vertex3i"),
|
||||
("\\bglVertex3iv", "chromium.Vertex3iv"),
|
||||
("\\bglVertex3s", "chromium.Vertex3s"),
|
||||
("\\bglVertex3sv", "chromium.Vertex3sv"),
|
||||
("\\bglVertex4d", "chromium.Vertex4d"),
|
||||
("\\bglVertex4dv", "chromium.Vertex4dv"),
|
||||
("\\bglVertex4f", "chromium.Vertex4f"),
|
||||
("\\bglVertex4fv", "chromium.Vertex4fv"),
|
||||
("\\bglVertex4i", "chromium.Vertex4i"),
|
||||
("\\bglVertex4iv", "chromium.Vertex4iv"),
|
||||
("\\bglVertex4s", "chromium.Vertex4s"),
|
||||
("\\bglVertex4sv", "chromium.Vertex4sv"),
|
||||
("\\bglVertexPointer", "chromium.VertexPointer"),
|
||||
("\\bglViewport", "chromium.Viewport"),
|
||||
("\\bglWriteback", "chromium.Writeback"),
|
||||
|
||||
|
||||
#define glAccum chromium.Accum
|
||||
#define glActiveTextureARB chromium.ActiveTextureARB
|
||||
#define glAlphaFunc chromium.AlphaFunc
|
||||
#define glAreTexturesResident chromium.AreTexturesResident
|
||||
#define glArrayElement chromium.ArrayElement
|
||||
#define glBarrierCreate chromium.BarrierCreate
|
||||
#define glBarrierDestroy chromium.BarrierDestroy
|
||||
#define glBarrierExec chromium.BarrierExec
|
||||
#define glBegin chromium.Begin
|
||||
#define glBindTexture chromium.BindTexture
|
||||
#define glBitmap chromium.Bitmap
|
||||
#define glBlendColorEXT chromium.BlendColorEXT
|
||||
#define glBlendEquationEXT chromium.BlendEquationEXT
|
||||
#define glBlendFunc chromium.BlendFunc
|
||||
#define glBoundsInfo chromium.BoundsInfo
|
||||
#define glCallList chromium.CallList
|
||||
#define glCallLists chromium.CallLists
|
||||
#define glChromiumParameterfCR chromium.ChromiumParameterfCR
|
||||
#define glChromiumParameteriCR chromium.ChromiumParameteriCR
|
||||
#define glChromiumParametervCR chromium.ChromiumParametervCR
|
||||
#define glClear chromium.Clear
|
||||
#define glClearAccum chromium.ClearAccum
|
||||
#define glClearColor chromium.ClearColor
|
||||
#define glClearDepth chromium.ClearDepth
|
||||
#define glClearIndex chromium.ClearIndex
|
||||
#define glClearStencil chromium.ClearStencil
|
||||
#define glClientActiveTextureARB chromium.ClientActiveTextureARB
|
||||
#define glClipPlane chromium.ClipPlane
|
||||
#define glColor3b chromium.Color3b
|
||||
#define glColor3bv chromium.Color3bv
|
||||
#define glColor3d chromium.Color3d
|
||||
#define glColor3dv chromium.Color3dv
|
||||
#define glColor3f chromium.Color3f
|
||||
#define glColor3fv chromium.Color3fv
|
||||
#define glColor3i chromium.Color3i
|
||||
#define glColor3iv chromium.Color3iv
|
||||
#define glColor3s chromium.Color3s
|
||||
#define glColor3sv chromium.Color3sv
|
||||
#define glColor3ub chromium.Color3ub
|
||||
#define glColor3ubv chromium.Color3ubv
|
||||
#define glColor3ui chromium.Color3ui
|
||||
#define glColor3uiv chromium.Color3uiv
|
||||
#define glColor3us chromium.Color3us
|
||||
#define glColor3usv chromium.Color3usv
|
||||
#define glColor4b chromium.Color4b
|
||||
#define glColor4bv chromium.Color4bv
|
||||
#define glColor4d chromium.Color4d
|
||||
#define glColor4dv chromium.Color4dv
|
||||
#define glColor4f chromium.Color4f
|
||||
#define glColor4fv chromium.Color4fv
|
||||
#define glColor4i chromium.Color4i
|
||||
#define glColor4iv chromium.Color4iv
|
||||
#define glColor4s chromium.Color4s
|
||||
#define glColor4sv chromium.Color4sv
|
||||
#define glColor4ub chromium.Color4ub
|
||||
#define glColor4ubv chromium.Color4ubv
|
||||
#define glColor4ui chromium.Color4ui
|
||||
#define glColor4uiv chromium.Color4uiv
|
||||
#define glColor4us chromium.Color4us
|
||||
#define glColor4usv chromium.Color4usv
|
||||
#define glColorMask chromium.ColorMask
|
||||
#define glColorMaterial chromium.ColorMaterial
|
||||
#define glColorPointer chromium.ColorPointer
|
||||
#define glCombinerInputNV chromium.CombinerInputNV
|
||||
#define glCombinerOutputNV chromium.CombinerOutputNV
|
||||
#define glCombinerParameterfNV chromium.CombinerParameterfNV
|
||||
#define glCombinerParameterfvNV chromium.CombinerParameterfvNV
|
||||
#define glCombinerParameteriNV chromium.CombinerParameteriNV
|
||||
#define glCombinerParameterivNV chromium.CombinerParameterivNV
|
||||
#define glCombinerStageParameterfvNV chromium.CombinerStageParameterfvNV
|
||||
#define glCopyPixels chromium.CopyPixels
|
||||
#define glCopyTexImage1D chromium.CopyTexImage1D
|
||||
#define glCopyTexImage2D chromium.CopyTexImage2D
|
||||
#define glCopyTexSubImage1D chromium.CopyTexSubImage1D
|
||||
#define glCopyTexSubImage2D chromium.CopyTexSubImage2D
|
||||
#define glCreateContext chromium.CreateContext
|
||||
#define glCullFace chromium.CullFace
|
||||
#define glDeleteLists chromium.DeleteLists
|
||||
#define glDeleteTextures chromium.DeleteTextures
|
||||
#define glDepthFunc chromium.DepthFunc
|
||||
#define glDepthMask chromium.DepthMask
|
||||
#define glDepthRange chromium.DepthRange
|
||||
#define glDestroyContext chromium.DestroyContext
|
||||
#define glDisable chromium.Disable
|
||||
#define glDisableClientState chromium.DisableClientState
|
||||
#define glDrawArrays chromium.DrawArrays
|
||||
#define glDrawBuffer chromium.DrawBuffer
|
||||
#define glDrawElements chromium.DrawElements
|
||||
#define glDrawPixels chromium.DrawPixels
|
||||
#define glDrawRangeElements chromium.DrawRangeElements
|
||||
#define glEdgeFlag chromium.EdgeFlag
|
||||
#define glEdgeFlagPointer chromium.EdgeFlagPointer
|
||||
#define glEdgeFlagv chromium.EdgeFlagv
|
||||
#define glEnable chromium.Enable
|
||||
#define glEnableClientState chromium.EnableClientState
|
||||
#define glEnd chromium.End
|
||||
#define glEndList chromium.EndList
|
||||
#define glEvalCoord1d chromium.EvalCoord1d
|
||||
#define glEvalCoord1dv chromium.EvalCoord1dv
|
||||
#define glEvalCoord1f chromium.EvalCoord1f
|
||||
#define glEvalCoord1fv chromium.EvalCoord1fv
|
||||
#define glEvalCoord2d chromium.EvalCoord2d
|
||||
#define glEvalCoord2dv chromium.EvalCoord2dv
|
||||
#define glEvalCoord2f chromium.EvalCoord2f
|
||||
#define glEvalCoord2fv chromium.EvalCoord2fv
|
||||
#define glEvalMesh1 chromium.EvalMesh1
|
||||
#define glEvalMesh2 chromium.EvalMesh2
|
||||
#define glEvalPoint1 chromium.EvalPoint1
|
||||
#define glEvalPoint2 chromium.EvalPoint2
|
||||
#define glFeedbackBuffer chromium.FeedbackBuffer
|
||||
#define glFinalCombinerInputNV chromium.FinalCombinerInputNV
|
||||
#define glFinish chromium.Finish
|
||||
#define glFlush chromium.Flush
|
||||
#define glFogf chromium.Fogf
|
||||
#define glFogfv chromium.Fogfv
|
||||
#define glFogi chromium.Fogi
|
||||
#define glFogiv chromium.Fogiv
|
||||
#define glFrontFace chromium.FrontFace
|
||||
#define glFrustum chromium.Frustum
|
||||
#define glGenLists chromium.GenLists
|
||||
#define glGenTextures chromium.GenTextures
|
||||
#define glGetBooleanv chromium.GetBooleanv
|
||||
#define glGetChromiumParametervCR chromium.GetChromiumParametervCR
|
||||
#define glGetClipPlane chromium.GetClipPlane
|
||||
#define glGetCombinerInputParameterfvNV chromium.GetCombinerInputParameterfvNV
|
||||
#define glGetCombinerInputParameterivNV chromium.GetCombinerInputParameterivNV
|
||||
#define glGetCombinerOutputParameterfvNV chromium.GetCombinerOutputParameterfvNV
|
||||
#define glGetCombinerOutputParameterivNV chromium.GetCombinerOutputParameterivNV
|
||||
#define glGetCombinerStageParameterfvNV chromium.GetCombinerStageParameterfvNV
|
||||
#define glGetDoublev chromium.GetDoublev
|
||||
#define glGetError chromium.GetError
|
||||
#define glGetFinalCombinerInputParameterfvNV chromium.GetFinalCombinerInputParameterfvNV
|
||||
#define glGetFinalCombinerInputParameterivNV chromium.GetFinalCombinerInputParameterivNV
|
||||
#define glGetFloatv chromium.GetFloatv
|
||||
#define glGetIntegerv chromium.GetIntegerv
|
||||
#define glGetLightfv chromium.GetLightfv
|
||||
#define glGetLightiv chromium.GetLightiv
|
||||
#define glGetMapdv chromium.GetMapdv
|
||||
#define glGetMapfv chromium.GetMapfv
|
||||
#define glGetMapiv chromium.GetMapiv
|
||||
#define glGetMaterialfv chromium.GetMaterialfv
|
||||
#define glGetMaterialiv chromium.GetMaterialiv
|
||||
#define glGetPixelMapfv chromium.GetPixelMapfv
|
||||
#define glGetPixelMapuiv chromium.GetPixelMapuiv
|
||||
#define glGetPixelMapusv chromium.GetPixelMapusv
|
||||
#define glGetPointerv chromium.GetPointerv
|
||||
#define glGetPolygonStipple chromium.GetPolygonStipple
|
||||
#define glGetString chromium.GetString
|
||||
#define glGetTexEnvfv chromium.GetTexEnvfv
|
||||
#define glGetTexEnviv chromium.GetTexEnviv
|
||||
#define glGetTexGendv chromium.GetTexGendv
|
||||
#define glGetTexGenfv chromium.GetTexGenfv
|
||||
#define glGetTexGeniv chromium.GetTexGeniv
|
||||
#define glGetTexImage chromium.GetTexImage
|
||||
#define glGetTexLevelParameterfv chromium.GetTexLevelParameterfv
|
||||
#define glGetTexLevelParameteriv chromium.GetTexLevelParameteriv
|
||||
#define glGetTexParameterfv chromium.GetTexParameterfv
|
||||
#define glGetTexParameteriv chromium.GetTexParameteriv
|
||||
#define glHint chromium.Hint
|
||||
#define glIndexMask chromium.IndexMask
|
||||
#define glIndexPointer chromium.IndexPointer
|
||||
#define glIndexd chromium.Indexd
|
||||
#define glIndexdv chromium.Indexdv
|
||||
#define glIndexf chromium.Indexf
|
||||
#define glIndexfv chromium.Indexfv
|
||||
#define glIndexi chromium.Indexi
|
||||
#define glIndexiv chromium.Indexiv
|
||||
#define glIndexs chromium.Indexs
|
||||
#define glIndexsv chromium.Indexsv
|
||||
#define glIndexub chromium.Indexub
|
||||
#define glIndexubv chromium.Indexubv
|
||||
#define glInitNames chromium.InitNames
|
||||
#define glInterleavedArrays chromium.InterleavedArrays
|
||||
#define glIsEnabled chromium.IsEnabled
|
||||
#define glIsList chromium.IsList
|
||||
#define glIsTexture chromium.IsTexture
|
||||
#define glLightModelf chromium.LightModelf
|
||||
#define glLightModelfv chromium.LightModelfv
|
||||
#define glLightModeli chromium.LightModeli
|
||||
#define glLightModeliv chromium.LightModeliv
|
||||
#define glLightf chromium.Lightf
|
||||
#define glLightfv chromium.Lightfv
|
||||
#define glLighti chromium.Lighti
|
||||
#define glLightiv chromium.Lightiv
|
||||
#define glLineStipple chromium.LineStipple
|
||||
#define glLineWidth chromium.LineWidth
|
||||
#define glListBase chromium.ListBase
|
||||
#define glLoadIdentity chromium.LoadIdentity
|
||||
#define glLoadMatrixd chromium.LoadMatrixd
|
||||
#define glLoadMatrixf chromium.LoadMatrixf
|
||||
#define glLoadName chromium.LoadName
|
||||
#define glLogicOp chromium.LogicOp
|
||||
#define glMakeCurrent chromium.MakeCurrent
|
||||
#define glMap1d chromium.Map1d
|
||||
#define glMap1f chromium.Map1f
|
||||
#define glMap2d chromium.Map2d
|
||||
#define glMap2f chromium.Map2f
|
||||
#define glMapGrid1d chromium.MapGrid1d
|
||||
#define glMapGrid1f chromium.MapGrid1f
|
||||
#define glMapGrid2d chromium.MapGrid2d
|
||||
#define glMapGrid2f chromium.MapGrid2f
|
||||
#define glMaterialf chromium.Materialf
|
||||
#define glMaterialfv chromium.Materialfv
|
||||
#define glMateriali chromium.Materiali
|
||||
#define glMaterialiv chromium.Materialiv
|
||||
#define glMatrixMode chromium.MatrixMode
|
||||
#define glMultMatrixd chromium.MultMatrixd
|
||||
#define glMultMatrixf chromium.MultMatrixf
|
||||
#define glMultiTexCoord1dARB chromium.MultiTexCoord1dARB
|
||||
#define glMultiTexCoord1dvARB chromium.MultiTexCoord1dvARB
|
||||
#define glMultiTexCoord1fARB chromium.MultiTexCoord1fARB
|
||||
#define glMultiTexCoord1fvARB chromium.MultiTexCoord1fvARB
|
||||
#define glMultiTexCoord1iARB chromium.MultiTexCoord1iARB
|
||||
#define glMultiTexCoord1ivARB chromium.MultiTexCoord1ivARB
|
||||
#define glMultiTexCoord1sARB chromium.MultiTexCoord1sARB
|
||||
#define glMultiTexCoord1svARB chromium.MultiTexCoord1svARB
|
||||
#define glMultiTexCoord2dARB chromium.MultiTexCoord2dARB
|
||||
#define glMultiTexCoord2dvARB chromium.MultiTexCoord2dvARB
|
||||
#define glMultiTexCoord2fARB chromium.MultiTexCoord2fARB
|
||||
#define glMultiTexCoord2fvARB chromium.MultiTexCoord2fvARB
|
||||
#define glMultiTexCoord2iARB chromium.MultiTexCoord2iARB
|
||||
#define glMultiTexCoord2ivARB chromium.MultiTexCoord2ivARB
|
||||
#define glMultiTexCoord2sARB chromium.MultiTexCoord2sARB
|
||||
#define glMultiTexCoord2svARB chromium.MultiTexCoord2svARB
|
||||
#define glMultiTexCoord3dARB chromium.MultiTexCoord3dARB
|
||||
#define glMultiTexCoord3dvARB chromium.MultiTexCoord3dvARB
|
||||
#define glMultiTexCoord3fARB chromium.MultiTexCoord3fARB
|
||||
#define glMultiTexCoord3fvARB chromium.MultiTexCoord3fvARB
|
||||
#define glMultiTexCoord3iARB chromium.MultiTexCoord3iARB
|
||||
#define glMultiTexCoord3ivARB chromium.MultiTexCoord3ivARB
|
||||
#define glMultiTexCoord3sARB chromium.MultiTexCoord3sARB
|
||||
#define glMultiTexCoord3svARB chromium.MultiTexCoord3svARB
|
||||
#define glMultiTexCoord4dARB chromium.MultiTexCoord4dARB
|
||||
#define glMultiTexCoord4dvARB chromium.MultiTexCoord4dvARB
|
||||
#define glMultiTexCoord4fARB chromium.MultiTexCoord4fARB
|
||||
#define glMultiTexCoord4fvARB chromium.MultiTexCoord4fvARB
|
||||
#define glMultiTexCoord4iARB chromium.MultiTexCoord4iARB
|
||||
#define glMultiTexCoord4ivARB chromium.MultiTexCoord4ivARB
|
||||
#define glMultiTexCoord4sARB chromium.MultiTexCoord4sARB
|
||||
#define glMultiTexCoord4svARB chromium.MultiTexCoord4svARB
|
||||
#define glNewList chromium.NewList
|
||||
#define glNormal3b chromium.Normal3b
|
||||
#define glNormal3bv chromium.Normal3bv
|
||||
#define glNormal3d chromium.Normal3d
|
||||
#define glNormal3dv chromium.Normal3dv
|
||||
#define glNormal3f chromium.Normal3f
|
||||
#define glNormal3fv chromium.Normal3fv
|
||||
#define glNormal3i chromium.Normal3i
|
||||
#define glNormal3iv chromium.Normal3iv
|
||||
#define glNormal3s chromium.Normal3s
|
||||
#define glNormal3sv chromium.Normal3sv
|
||||
#define glNormalPointer chromium.NormalPointer
|
||||
#define glOrtho chromium.Ortho
|
||||
#define glPassThrough chromium.PassThrough
|
||||
#define glPixelMapfv chromium.PixelMapfv
|
||||
#define glPixelMapuiv chromium.PixelMapuiv
|
||||
#define glPixelMapusv chromium.PixelMapusv
|
||||
#define glPixelStoref chromium.PixelStoref
|
||||
#define glPixelStorei chromium.PixelStorei
|
||||
#define glPixelTransferf chromium.PixelTransferf
|
||||
#define glPixelTransferi chromium.PixelTransferi
|
||||
#define glPixelZoom chromium.PixelZoom
|
||||
#define glPointSize chromium.PointSize
|
||||
#define glPolygonMode chromium.PolygonMode
|
||||
#define glPolygonOffset chromium.PolygonOffset
|
||||
#define glPolygonStipple chromium.PolygonStipple
|
||||
#define glPopAttrib chromium.PopAttrib
|
||||
#define glPopClientAttrib chromium.PopClientAttrib
|
||||
#define glPopMatrix chromium.PopMatrix
|
||||
#define glPopName chromium.PopName
|
||||
#define glPrioritizeTextures chromium.PrioritizeTextures
|
||||
#define glPushAttrib chromium.PushAttrib
|
||||
#define glPushClientAttrib chromium.PushClientAttrib
|
||||
#define glPushMatrix chromium.PushMatrix
|
||||
#define glPushName chromium.PushName
|
||||
#define glRasterPos2d chromium.RasterPos2d
|
||||
#define glRasterPos2dv chromium.RasterPos2dv
|
||||
#define glRasterPos2f chromium.RasterPos2f
|
||||
#define glRasterPos2fv chromium.RasterPos2fv
|
||||
#define glRasterPos2i chromium.RasterPos2i
|
||||
#define glRasterPos2iv chromium.RasterPos2iv
|
||||
#define glRasterPos2s chromium.RasterPos2s
|
||||
#define glRasterPos2sv chromium.RasterPos2sv
|
||||
#define glRasterPos3d chromium.RasterPos3d
|
||||
#define glRasterPos3dv chromium.RasterPos3dv
|
||||
#define glRasterPos3f chromium.RasterPos3f
|
||||
#define glRasterPos3fv chromium.RasterPos3fv
|
||||
#define glRasterPos3i chromium.RasterPos3i
|
||||
#define glRasterPos3iv chromium.RasterPos3iv
|
||||
#define glRasterPos3s chromium.RasterPos3s
|
||||
#define glRasterPos3sv chromium.RasterPos3sv
|
||||
#define glRasterPos4d chromium.RasterPos4d
|
||||
#define glRasterPos4dv chromium.RasterPos4dv
|
||||
#define glRasterPos4f chromium.RasterPos4f
|
||||
#define glRasterPos4fv chromium.RasterPos4fv
|
||||
#define glRasterPos4i chromium.RasterPos4i
|
||||
#define glRasterPos4iv chromium.RasterPos4iv
|
||||
#define glRasterPos4s chromium.RasterPos4s
|
||||
#define glRasterPos4sv chromium.RasterPos4sv
|
||||
#define glReadBuffer chromium.ReadBuffer
|
||||
#define glReadPixels chromium.ReadPixels
|
||||
#define glRectd chromium.Rectd
|
||||
#define glRectdv chromium.Rectdv
|
||||
#define glRectf chromium.Rectf
|
||||
#define glRectfv chromium.Rectfv
|
||||
#define glRecti chromium.Recti
|
||||
#define glRectiv chromium.Rectiv
|
||||
#define glRects chromium.Rects
|
||||
#define glRectsv chromium.Rectsv
|
||||
#define glRenderMode chromium.RenderMode
|
||||
#define glRotated chromium.Rotated
|
||||
#define glRotatef chromium.Rotatef
|
||||
#define glScaled chromium.Scaled
|
||||
#define glScalef chromium.Scalef
|
||||
#define glScissor chromium.Scissor
|
||||
#define glSecondaryColor3bEXT chromium.SecondaryColor3bEXT
|
||||
#define glSecondaryColor3bvEXT chromium.SecondaryColor3bvEXT
|
||||
#define glSecondaryColor3dEXT chromium.SecondaryColor3dEXT
|
||||
#define glSecondaryColor3dvEXT chromium.SecondaryColor3dvEXT
|
||||
#define glSecondaryColor3fEXT chromium.SecondaryColor3fEXT
|
||||
#define glSecondaryColor3fvEXT chromium.SecondaryColor3fvEXT
|
||||
#define glSecondaryColor3iEXT chromium.SecondaryColor3iEXT
|
||||
#define glSecondaryColor3ivEXT chromium.SecondaryColor3ivEXT
|
||||
#define glSecondaryColor3sEXT chromium.SecondaryColor3sEXT
|
||||
#define glSecondaryColor3svEXT chromium.SecondaryColor3svEXT
|
||||
#define glSecondaryColor3ubEXT chromium.SecondaryColor3ubEXT
|
||||
#define glSecondaryColor3ubvEXT chromium.SecondaryColor3ubvEXT
|
||||
#define glSecondaryColor3uiEXT chromium.SecondaryColor3uiEXT
|
||||
#define glSecondaryColor3uivEXT chromium.SecondaryColor3uivEXT
|
||||
#define glSecondaryColor3usEXT chromium.SecondaryColor3usEXT
|
||||
#define glSecondaryColor3usvEXT chromium.SecondaryColor3usvEXT
|
||||
#define glSecondaryColorPointerEXT chromium.SecondaryColorPointerEXT
|
||||
#define glSelectBuffer chromium.SelectBuffer
|
||||
#define glSemaphoreCreate chromium.SemaphoreCreate
|
||||
#define glSemaphoreDestroy chromium.SemaphoreDestroy
|
||||
#define glSemaphoreP chromium.SemaphoreP
|
||||
#define glSemaphoreV chromium.SemaphoreV
|
||||
#define glShadeModel chromium.ShadeModel
|
||||
#define glStencilFunc chromium.StencilFunc
|
||||
#define glStencilMask chromium.StencilMask
|
||||
#define glStencilOp chromium.StencilOp
|
||||
#define glSwapBuffers chromium.SwapBuffers
|
||||
#define glTexCoord1d chromium.TexCoord1d
|
||||
#define glTexCoord1dv chromium.TexCoord1dv
|
||||
#define glTexCoord1f chromium.TexCoord1f
|
||||
#define glTexCoord1fv chromium.TexCoord1fv
|
||||
#define glTexCoord1i chromium.TexCoord1i
|
||||
#define glTexCoord1iv chromium.TexCoord1iv
|
||||
#define glTexCoord1s chromium.TexCoord1s
|
||||
#define glTexCoord1sv chromium.TexCoord1sv
|
||||
#define glTexCoord2d chromium.TexCoord2d
|
||||
#define glTexCoord2dv chromium.TexCoord2dv
|
||||
#define glTexCoord2f chromium.TexCoord2f
|
||||
#define glTexCoord2fv chromium.TexCoord2fv
|
||||
#define glTexCoord2i chromium.TexCoord2i
|
||||
#define glTexCoord2iv chromium.TexCoord2iv
|
||||
#define glTexCoord2s chromium.TexCoord2s
|
||||
#define glTexCoord2sv chromium.TexCoord2sv
|
||||
#define glTexCoord3d chromium.TexCoord3d
|
||||
#define glTexCoord3dv chromium.TexCoord3dv
|
||||
#define glTexCoord3f chromium.TexCoord3f
|
||||
#define glTexCoord3fv chromium.TexCoord3fv
|
||||
#define glTexCoord3i chromium.TexCoord3i
|
||||
#define glTexCoord3iv chromium.TexCoord3iv
|
||||
#define glTexCoord3s chromium.TexCoord3s
|
||||
#define glTexCoord3sv chromium.TexCoord3sv
|
||||
#define glTexCoord4d chromium.TexCoord4d
|
||||
#define glTexCoord4dv chromium.TexCoord4dv
|
||||
#define glTexCoord4f chromium.TexCoord4f
|
||||
#define glTexCoord4fv chromium.TexCoord4fv
|
||||
#define glTexCoord4i chromium.TexCoord4i
|
||||
#define glTexCoord4iv chromium.TexCoord4iv
|
||||
#define glTexCoord4s chromium.TexCoord4s
|
||||
#define glTexCoord4sv chromium.TexCoord4sv
|
||||
#define glTexCoordPointer chromium.TexCoordPointer
|
||||
#define glTexEnvf chromium.TexEnvf
|
||||
#define glTexEnvfv chromium.TexEnvfv
|
||||
#define glTexEnvi chromium.TexEnvi
|
||||
#define glTexEnviv chromium.TexEnviv
|
||||
#define glTexGend chromium.TexGend
|
||||
#define glTexGendv chromium.TexGendv
|
||||
#define glTexGenf chromium.TexGenf
|
||||
#define glTexGenfv chromium.TexGenfv
|
||||
#define glTexGeni chromium.TexGeni
|
||||
#define glTexGeniv chromium.TexGeniv
|
||||
#define glTexImage1D chromium.TexImage1D
|
||||
#define glTexImage2D chromium.TexImage2D
|
||||
#define glTexParameterf chromium.TexParameterf
|
||||
#define glTexParameterfv chromium.TexParameterfv
|
||||
#define glTexParameteri chromium.TexParameteri
|
||||
#define glTexParameteriv chromium.TexParameteriv
|
||||
#define glTexSubImage1D chromium.TexSubImage1D
|
||||
#define glTexSubImage2D chromium.TexSubImage2D
|
||||
#define glTranslated chromium.Translated
|
||||
#define glTranslatef chromium.Translatef
|
||||
#define glVertex2d chromium.Vertex2d
|
||||
#define glVertex2dv chromium.Vertex2dv
|
||||
#define glVertex2f chromium.Vertex2f
|
||||
#define glVertex2fv chromium.Vertex2fv
|
||||
#define glVertex2i chromium.Vertex2i
|
||||
#define glVertex2iv chromium.Vertex2iv
|
||||
#define glVertex2s chromium.Vertex2s
|
||||
#define glVertex2sv chromium.Vertex2sv
|
||||
#define glVertex3d chromium.Vertex3d
|
||||
#define glVertex3dv chromium.Vertex3dv
|
||||
#define glVertex3f chromium.Vertex3f
|
||||
#define glVertex3fv chromium.Vertex3fv
|
||||
#define glVertex3i chromium.Vertex3i
|
||||
#define glVertex3iv chromium.Vertex3iv
|
||||
#define glVertex3s chromium.Vertex3s
|
||||
#define glVertex3sv chromium.Vertex3sv
|
||||
#define glVertex4d chromium.Vertex4d
|
||||
#define glVertex4dv chromium.Vertex4dv
|
||||
#define glVertex4f chromium.Vertex4f
|
||||
#define glVertex4fv chromium.Vertex4fv
|
||||
#define glVertex4i chromium.Vertex4i
|
||||
#define glVertex4iv chromium.Vertex4iv
|
||||
#define glVertex4s chromium.Vertex4s
|
||||
#define glVertex4sv chromium.Vertex4sv
|
||||
#define glVertexPointer chromium.VertexPointer
|
||||
#define glViewport chromium.Viewport
|
||||
#define glWriteback chromium.Writeback
|
||||
|
||||
|
||||
#define glgsg crgsg
|
||||
#define NotifyCategoryGetCategory_glgsg NotifyCategoryGetCategory_crgsg
|
||||
|
||||
#define gl_show_transforms cr_show_transforms
|
||||
#define gl_cheap_textures cr_cheap_textures
|
||||
#define gl_cull_traversal cr_cull_traversal
|
||||
#define gl_ignore_mipmaps cr_ignore_mipmaps
|
||||
#define gl_force_mipmaps cr_force_mipmaps
|
||||
#define gl_show_mipmaps cr_show_mipmaps
|
||||
#define gl_save_mipmaps cr_save_mipmaps
|
||||
#define gl_auto_normalize_lighting cr_auto_normalize_lighting
|
||||
#define gl_supports_bgr cr_supports_bgr
|
||||
|
||||
#define GLDecalType CRDecalType
|
||||
#define gl_decal_type cr_decal_type
|
||||
|
||||
#define init_libglgsg init_libcrgsg
|
||||
|
||||
|
||||
#define glgsg_cat crgsg_cat
|
||||
|
||||
#define GLGraphicsStateGuardian CRGraphicsStateGuardian
|
||||
#define GLTextureContext CRTextureContext
|
||||
#define GLGeomNodeContext CRGeomNodeContext
|
||||
#define GLSavedFrameBuffer CRSavedFrameBuffer
|
||||
|
||||
#define make_GlGraphicsStateGuardian make_CRGraphicsStateGuardian
|
||||
|
||||
"""
|
File diff suppressed because it is too large
Load Diff
@ -1,5 +0,0 @@
|
||||
|
||||
#include "config_crgsg.cxx"
|
||||
#include "crSavedFrameBuffer.cxx"
|
||||
#include "crGeomNodeContext.cxx"
|
||||
#include "crTextureContext.cxx"
|
@ -1,6 +0,0 @@
|
||||
|
||||
<h1> CR GSG </h1>
|
||||
|
||||
<p> The Chromium Graphics State Guardian. </p>
|
||||
|
||||
<p> CR is an abbreviation for Chromium. <p>
|
@ -18,7 +18,6 @@
|
||||
displayRegionStack.h \
|
||||
frameBufferProperties.I frameBufferProperties.h \
|
||||
frameBufferStack.I frameBufferStack.h \
|
||||
geomContext.I geomContext.h geomNodeContext.I geomNodeContext.h \
|
||||
graphicsChannel.I graphicsChannel.h \
|
||||
graphicsEngine.I graphicsEngine.h \
|
||||
graphicsLayer.I \
|
||||
@ -46,7 +45,7 @@
|
||||
drawableRegion.cxx \
|
||||
displayRegion.cxx \
|
||||
frameBufferProperties.cxx \
|
||||
geomContext.cxx geomNodeContext.cxx graphicsChannel.cxx \
|
||||
graphicsChannel.cxx \
|
||||
graphicsEngine.cxx \
|
||||
graphicsLayer.cxx \
|
||||
graphicsOutput.cxx \
|
||||
@ -69,7 +68,6 @@
|
||||
displayRegionStack.h \
|
||||
frameBufferProperties.I frameBufferProperties.h \
|
||||
frameBufferStack.I frameBufferStack.h \
|
||||
geomContext.I geomContext.h geomNodeContext.I geomNodeContext.h \
|
||||
graphicsChannel.I graphicsChannel.h \
|
||||
graphicsEngine.I graphicsEngine.h \
|
||||
graphicsLayer.I graphicsLayer.h \
|
||||
|
@ -29,7 +29,6 @@
|
||||
#include "parasiteBuffer.h"
|
||||
#include "hardwareChannel.h"
|
||||
#include "textureContext.h"
|
||||
#include "geomNodeContext.h"
|
||||
#include "geomContext.h"
|
||||
|
||||
ConfigureDef(config_display);
|
||||
@ -137,6 +136,5 @@ init_libdisplay() {
|
||||
HardwareChannel::init_type();
|
||||
ParasiteBuffer::init_type();
|
||||
TextureContext::init_type();
|
||||
GeomNodeContext::init_type();
|
||||
GeomContext::init_type();
|
||||
}
|
||||
|
@ -1,7 +1,6 @@
|
||||
#include "drawableRegion.cxx"
|
||||
#include "displayRegion.cxx"
|
||||
#include "geomContext.cxx"
|
||||
#include "geomNodeContext.cxx"
|
||||
#include "graphicsChannel.cxx"
|
||||
#include "graphicsEngine.cxx"
|
||||
#include "graphicsLayer.cxx"
|
||||
|
@ -1,27 +0,0 @@
|
||||
// Filename: geomContext.I
|
||||
// Created by: drose (11Jun01)
|
||||
//
|
||||
////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// PANDA 3D SOFTWARE
|
||||
// Copyright (c) 2001 - 2004, Disney Enterprises, Inc. All rights reserved
|
||||
//
|
||||
// All use of this software is subject to the terms of the Panda 3d
|
||||
// Software license. You should have received a copy of this license
|
||||
// along with this source code; you will also find a current copy of
|
||||
// the license at http://etc.cmu.edu/panda3d/docs/license/ .
|
||||
//
|
||||
// To contact the maintainers of this program write to
|
||||
// panda3d-general@lists.sourceforge.net .
|
||||
//
|
||||
////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
// Function: GeomContext::Constructor
|
||||
// Access: Public
|
||||
// Description:
|
||||
////////////////////////////////////////////////////////////////////
|
||||
INLINE GeomContext::
|
||||
GeomContext(Geom *geom) : _geom(geom) {
|
||||
}
|
@ -1,29 +0,0 @@
|
||||
// Filename: geomNodeContext.I
|
||||
// Created by: drose (11Jun01)
|
||||
//
|
||||
////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// PANDA 3D SOFTWARE
|
||||
// Copyright (c) 2001 - 2004, Disney Enterprises, Inc. All rights reserved
|
||||
//
|
||||
// All use of this software is subject to the terms of the Panda 3d
|
||||
// Software license. You should have received a copy of this license
|
||||
// along with this source code; you will also find a current copy of
|
||||
// the license at http://etc.cmu.edu/panda3d/docs/license/ .
|
||||
//
|
||||
// To contact the maintainers of this program write to
|
||||
// panda3d-general@lists.sourceforge.net .
|
||||
//
|
||||
////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
// Function: GeomNodeContext::Constructor
|
||||
// Access: Public
|
||||
// Description:
|
||||
////////////////////////////////////////////////////////////////////
|
||||
INLINE GeomNodeContext::
|
||||
GeomNodeContext(GeomNode *node) :
|
||||
_node(node)
|
||||
{
|
||||
}
|
@ -1,21 +0,0 @@
|
||||
// Filename: geomNodeContext.cxx
|
||||
// Created by: drose (11Jun01)
|
||||
//
|
||||
////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// PANDA 3D SOFTWARE
|
||||
// Copyright (c) 2001 - 2004, Disney Enterprises, Inc. All rights reserved
|
||||
//
|
||||
// All use of this software is subject to the terms of the Panda 3d
|
||||
// Software license. You should have received a copy of this license
|
||||
// along with this source code; you will also find a current copy of
|
||||
// the license at http://etc.cmu.edu/panda3d/docs/license/ .
|
||||
//
|
||||
// To contact the maintainers of this program write to
|
||||
// panda3d-general@lists.sourceforge.net .
|
||||
//
|
||||
////////////////////////////////////////////////////////////////////
|
||||
|
||||
#include "geomNodeContext.h"
|
||||
|
||||
TypeHandle GeomNodeContext::_type_handle;
|
@ -1,75 +0,0 @@
|
||||
// Filename: geomNodeContext.h
|
||||
// Created by: drose (11Jun01)
|
||||
//
|
||||
////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// PANDA 3D SOFTWARE
|
||||
// Copyright (c) 2001 - 2004, Disney Enterprises, Inc. All rights reserved
|
||||
//
|
||||
// All use of this software is subject to the terms of the Panda 3d
|
||||
// Software license. You should have received a copy of this license
|
||||
// along with this source code; you will also find a current copy of
|
||||
// the license at http://etc.cmu.edu/panda3d/docs/license/ .
|
||||
//
|
||||
// To contact the maintainers of this program write to
|
||||
// panda3d-general@lists.sourceforge.net .
|
||||
//
|
||||
////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef GEOMNODECONTEXT_H
|
||||
#define GEOMNODECONTEXT_H
|
||||
|
||||
#include "pandabase.h"
|
||||
|
||||
#include "savedContext.h"
|
||||
|
||||
class GeomNode;
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
// Class : GeomNodeContext
|
||||
// Description : This is a special class object, similar to a
|
||||
// TextureContext, that holds all the information
|
||||
// returned by a particular GSG to cache the rendering
|
||||
// information associated with one or more GeomNodes.
|
||||
// This is similar to, but different from, a Geom
|
||||
// context, which is associated with the containing Geom
|
||||
// class; a GSG might prefer to associate data with
|
||||
// either the Geom or the GeomNode or both.
|
||||
//
|
||||
// This allows the GSG to precompute some information
|
||||
// necessary for drawing the Geoms as quickly as
|
||||
// possible and reuse that information across multiple
|
||||
// frames. Typically, only static Geoms
|
||||
// (e.g. nonindexed) will be assigned GeomContexts.
|
||||
////////////////////////////////////////////////////////////////////
|
||||
class EXPCL_PANDA GeomNodeContext : public SavedContext {
|
||||
public:
|
||||
INLINE GeomNodeContext(GeomNode *node);
|
||||
|
||||
// This cannot be a PT(GeomNode), because the geomNode and the GSG
|
||||
// both own their GeomNodeContexts! That would create a circular
|
||||
// reference count.
|
||||
GeomNode *_node;
|
||||
|
||||
public:
|
||||
static TypeHandle get_class_type() {
|
||||
return _type_handle;
|
||||
}
|
||||
static void init_type() {
|
||||
SavedContext::init_type();
|
||||
register_type(_type_handle, "GeomNodeContext",
|
||||
SavedContext::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;
|
||||
};
|
||||
|
||||
#include "geomNodeContext.I"
|
||||
|
||||
#endif
|
||||
|
@ -195,48 +195,6 @@ void GraphicsStateGuardian::
|
||||
release_texture(TextureContext *) {
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
// Function: GraphicsStateGuardian::prepare_geom_node
|
||||
// Access: Public, Virtual
|
||||
// Description: Prepares the indicated GeomNode for retained-mode
|
||||
// rendering. If this function returns non-NULL, the
|
||||
// value returned will be passed back to a future call
|
||||
// to draw_geom_node(), which is expected to draw the
|
||||
// contents of the node.
|
||||
////////////////////////////////////////////////////////////////////
|
||||
GeomNodeContext *GraphicsStateGuardian::
|
||||
prepare_geom_node(GeomNode *) {
|
||||
return (GeomNodeContext *)NULL;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
// Function: GraphicsStateGuardian::draw_geom_node
|
||||
// Access: Public, Virtual
|
||||
// Description: Draws a GeomNode previously indicated by a call to
|
||||
// prepare_geom_node().
|
||||
////////////////////////////////////////////////////////////////////
|
||||
void GraphicsStateGuardian::
|
||||
draw_geom_node(GeomNode *node, const RenderState *state,
|
||||
GeomNodeContext *) {
|
||||
#if 0 // temporarily disabled until ported to new scene graph
|
||||
int num_geoms = node->get_num_geoms();
|
||||
for (int i = 0; i < num_geoms; i++) {
|
||||
node->get_geom(i)->draw(this);
|
||||
}
|
||||
#endif // temporarily disabled until ported to new scene graph
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
// Function: GraphicsStateGuardian::release_geom_node
|
||||
// Access: Public, Virtual
|
||||
// Description: Frees the resources previously allocated via a call
|
||||
// to prepare_geom_node(), including deleting the
|
||||
// GeomNodeContext itself, if necessary.
|
||||
////////////////////////////////////////////////////////////////////
|
||||
void GraphicsStateGuardian::
|
||||
release_geom_node(GeomNodeContext *) {
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
// Function: GraphicsStateGuardian::prepare_geom
|
||||
// Access: Public, Virtual
|
||||
@ -1262,7 +1220,6 @@ init_frame_pstats() {
|
||||
if (PStatClient::is_connected()) {
|
||||
_current_textures.clear();
|
||||
_current_geoms.clear();
|
||||
_current_geom_nodes.clear();
|
||||
_active_texusage_pcollector.clear_level();
|
||||
_active_geom_pcollector.clear_level();
|
||||
_active_geom_node_pcollector.clear_level();
|
||||
@ -1313,24 +1270,6 @@ add_to_geom_record(GeomContext *gc) {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
// Function: GraphicsStateGuardian::add_to_geom_node_record
|
||||
// Access: Protected
|
||||
// Description: Records that the indicated GeomNode has been drawn
|
||||
// this frame. This function is only used to update the
|
||||
// PStats current_texmem collector; it gets compiled out
|
||||
// if we aren't using PStats.
|
||||
////////////////////////////////////////////////////////////////////
|
||||
void GraphicsStateGuardian::
|
||||
add_to_geom_node_record(GeomNodeContext *gnc) {
|
||||
if (PStatClient::is_connected()) {
|
||||
if (gnc != (GeomNodeContext *)NULL &&
|
||||
_current_geom_nodes.insert(gnc).second) {
|
||||
_active_geom_node_pcollector.add_level(1);
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif // DO_PSTATS
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
|
@ -91,11 +91,6 @@ public:
|
||||
virtual void apply_texture(TextureContext *tc);
|
||||
virtual void release_texture(TextureContext *tc);
|
||||
|
||||
virtual GeomNodeContext *prepare_geom_node(GeomNode *node);
|
||||
virtual void draw_geom_node(GeomNode *node, const RenderState *state,
|
||||
GeomNodeContext *gnc);
|
||||
virtual void release_geom_node(GeomNodeContext *gnc);
|
||||
|
||||
virtual GeomContext *prepare_geom(Geom *geom);
|
||||
virtual void release_geom(GeomContext *gc);
|
||||
|
||||
@ -208,16 +203,13 @@ protected:
|
||||
void init_frame_pstats();
|
||||
void add_to_texture_record(TextureContext *tc);
|
||||
void add_to_geom_record(GeomContext *gc);
|
||||
void add_to_geom_node_record(GeomNodeContext *gnc);
|
||||
|
||||
pset<TextureContext *> _current_textures;
|
||||
pset<GeomContext *> _current_geoms;
|
||||
pset<GeomNodeContext *> _current_geom_nodes;
|
||||
#else
|
||||
INLINE void init_frame_pstats() { }
|
||||
INLINE void add_to_texture_record(TextureContext *) { }
|
||||
INLINE void add_to_geom_record(GeomContext *) { }
|
||||
INLINE void add_to_geom_node_record(GeomNodeContext *) { }
|
||||
INLINE void record_state_change(TypeHandle) { }
|
||||
#endif
|
||||
|
||||
|
@ -21,7 +21,7 @@
|
||||
// need to install these due to external projects that link directly with libpandadx (bartop)
|
||||
#define INSTALL_HEADERS \
|
||||
config_dxgsg7.h dxGraphicsStateGuardian7.I dxGraphicsStateGuardian7.h \
|
||||
dxTextureContext7.h dxGeomNodeContext7.h dxGeomNodeContext7.I dxgsg7base.h
|
||||
dxTextureContext7.h dxgsg7base.h
|
||||
|
||||
// build dxGraphicsStateGuardian separately since its so big
|
||||
|
||||
@ -35,7 +35,6 @@
|
||||
config_dxgsg7.cxx \
|
||||
dxgsg7base.cxx \
|
||||
dxSavedFrameBuffer7.cxx dxTextureContext7.cxx \
|
||||
dxGeomNodeContext7.cxx \
|
||||
wdxGraphicsPipe7.cxx wdxGraphicsWindow7.cxx
|
||||
|
||||
#end lib_target
|
||||
|
@ -150,7 +150,6 @@ init_libdxgsg7() {
|
||||
DXGraphicsStateGuardian7::init_type();
|
||||
DXSavedFrameBuffer7::init_type();
|
||||
DXTextureContext7::init_type();
|
||||
DXGeomNodeContext7::init_type();
|
||||
|
||||
wdxGraphicsPipe7::init_type();
|
||||
wdxGraphicsWindow7::init_type();
|
||||
|
@ -1,31 +0,0 @@
|
||||
// Filename: dxGeomNodeContext7.I
|
||||
// Created by: drose (12Jun01)
|
||||
//
|
||||
////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// PANDA 3D SOFTWARE
|
||||
// Copyright (c) 2001 - 2004, Disney Enterprises, Inc. All rights reserved
|
||||
//
|
||||
// All use of this software is subject to the terms of the Panda 3d
|
||||
// Software license. You should have received a copy of this license
|
||||
// along with this source code; you will also find a current copy of
|
||||
// the license at http://etc.cmu.edu/panda3d/docs/license/ .
|
||||
//
|
||||
// To contact the maintainers of this program write to
|
||||
// panda3d-general@lists.sourceforge.net .
|
||||
//
|
||||
////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
// Function: DXGeomNodeContext7::Constructor
|
||||
// Access: Public
|
||||
// Description:
|
||||
////////////////////////////////////////////////////////////////////
|
||||
INLINE DXGeomNodeContext7::
|
||||
DXGeomNodeContext7(GeomNode *node) : GeomNodeContext(node)
|
||||
{
|
||||
_num_verts = 0;
|
||||
_pVB = NULL;
|
||||
_pXformed_VB = NULL;
|
||||
}
|
@ -1,33 +0,0 @@
|
||||
// Filename: dxGeomNodeContext7.cxx
|
||||
// Created by: drose (12Jun01)
|
||||
//
|
||||
////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// PANDA 3D SOFTWARE
|
||||
// Copyright (c) 2001 - 2004, Disney Enterprises, Inc. All rights reserved
|
||||
//
|
||||
// All use of this software is subject to the terms of the Panda 3d
|
||||
// Software license. You should have received a copy of this license
|
||||
// along with this source code; you will also find a current copy of
|
||||
// the license at http://etc.cmu.edu/panda3d/docs/license/ .
|
||||
//
|
||||
// To contact the maintainers of this program write to
|
||||
// panda3d-general@lists.sourceforge.net .
|
||||
//
|
||||
////////////////////////////////////////////////////////////////////
|
||||
|
||||
#include "DXGeomNodeContext7.h"
|
||||
|
||||
TypeHandle DXGeomNodeContext7::_type_handle;
|
||||
|
||||
DXGeomNodeContext7::~DXGeomNodeContext7()
|
||||
{
|
||||
if(_pXformed_VB!=NULL)
|
||||
_pXformed_VB->Release();
|
||||
_pXformed_VB=NULL;
|
||||
|
||||
if(_pVB!=NULL)
|
||||
_pVB->Release();
|
||||
_pVB=NULL;
|
||||
}
|
||||
|
@ -1,84 +0,0 @@
|
||||
// Filename: dxGeomNodeContext7.h
|
||||
// Created by: drose (12Jun01)
|
||||
//
|
||||
////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// PANDA 3D SOFTWARE
|
||||
// Copyright (c) 2001 - 2004, Disney Enterprises, Inc. All rights reserved
|
||||
//
|
||||
// All use of this software is subject to the terms of the Panda 3d
|
||||
// Software license. You should have received a copy of this license
|
||||
// along with this source code; you will also find a current copy of
|
||||
// the license at http://etc.cmu.edu/panda3d/docs/license/ .
|
||||
//
|
||||
// To contact the maintainers of this program write to
|
||||
// panda3d-general@lists.sourceforge.net .
|
||||
//
|
||||
////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef DXGEOMNODECONTEXT7_H
|
||||
#define DXGEOMNODECONTEXT7_H
|
||||
|
||||
#include "dxgsg7base.h"
|
||||
|
||||
#include "geomNodeContext.h"
|
||||
#include "geomNode.h"
|
||||
#include "pvector.h"
|
||||
|
||||
typedef struct {
|
||||
DWORD nVerts;
|
||||
D3DPRIMITIVETYPE primtype;
|
||||
} DPInfo;
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
// Class : DXGeomNodeContext7
|
||||
// Description :
|
||||
////////////////////////////////////////////////////////////////////
|
||||
class EXPCL_PANDADX DXGeomNodeContext7 : public GeomNodeContext {
|
||||
public:
|
||||
INLINE DXGeomNodeContext7(GeomNode *node);
|
||||
~DXGeomNodeContext7();
|
||||
|
||||
// A list of the dynamic Geoms within the GeomNode; these aren't
|
||||
// part of the above display list and must be drawn separately
|
||||
typedef pvector< PT(Geom) > Geoms;
|
||||
Geoms _cached_geoms,_other_geoms;
|
||||
|
||||
// VB's are already reference-counted by D3D, no need to make separate panda object to do that
|
||||
// but we will want a way to know if VB has already been xformed by ProcessVerts this frame
|
||||
// if multiple geomnodes share VBs
|
||||
|
||||
LPDIRECT3DVERTEXBUFFER7 _pVB;
|
||||
LPDIRECT3DVERTEXBUFFER7 _pXformed_VB;
|
||||
|
||||
int _start_index; // starting offset of this geom's verts within the VB
|
||||
int _num_verts; // number of verts used by this geomcontext within the VB
|
||||
|
||||
BYTE *_pEndofVertData; // ptr to end of current vert data in VB (note: only used/valid during setup)
|
||||
|
||||
// for multiple geoms per VB, either will have to regen lengths based on per* flags, or store
|
||||
// per geom vector of perprim vectors lengths
|
||||
vector<DPInfo> _PrimInfo;
|
||||
|
||||
public:
|
||||
static TypeHandle get_class_type() {
|
||||
return _type_handle;
|
||||
}
|
||||
static void init_type() {
|
||||
GeomNodeContext::init_type();
|
||||
register_type(_type_handle, "DXGeomNodeContext7",
|
||||
GeomNodeContext::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;
|
||||
};
|
||||
|
||||
#include "dxGeomNodeContext7.I"
|
||||
|
||||
#endif
|
||||
|
@ -5373,594 +5373,3 @@ HRESULT SetViewMatrix( D3DMATRIX& mat, D3DVECTOR& vFrom, D3DVECTOR& vAt,
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
// Function: DXGraphicsStateGuardian7::prepare_geom_node
|
||||
// Access: Public, Virtual
|
||||
// Description: Prepares the indicated GeomNode for retained-mode
|
||||
// rendering. If this function returns non-NULL, the
|
||||
// value returned will be passed back to a future call
|
||||
// to draw_geom_node(), which is expected to draw the
|
||||
// contents of the node.
|
||||
////////////////////////////////////////////////////////////////////
|
||||
GeomNodeContext *DXGraphicsStateGuardian7::
|
||||
prepare_geom_node(GeomNode *node) {
|
||||
#if 0 // temporarily disabled until ported to new scene graph
|
||||
if(link_tristrips) {
|
||||
for(int iGeom=0;iGeom<node->get_num_geoms();iGeom++) {
|
||||
dDrawable *drawable1 = node->get_geom(iGeom);
|
||||
|
||||
if(!drawable1->is_of_type(Geom::get_class_type()))
|
||||
continue;
|
||||
|
||||
Geom *geomptr=DCAST(Geom, drawable1);
|
||||
assert(geomptr!=NULL);
|
||||
|
||||
if(!geomptr->is_of_type(GeomTristrip::get_class_type()))
|
||||
continue;
|
||||
|
||||
GeomTristrip *me = DCAST(GeomTristrip, geomptr);
|
||||
assert(me!=NULL);
|
||||
|
||||
int nPrims=me->get_num_prims();
|
||||
if(nPrims==1)
|
||||
continue;
|
||||
|
||||
if(dxgsg7_cat.is_debug()) {
|
||||
static bool bPrintedMsg=false;
|
||||
if(!bPrintedMsg) {
|
||||
dxgsg7_cat.debug() << "linking tristrips together with degenerate tris\n";
|
||||
bPrintedMsg=true;
|
||||
}
|
||||
}
|
||||
|
||||
bool bStripReversalNeeded;
|
||||
unsigned int nOrigTotalVerts=0;
|
||||
PTA_int new_lengths;
|
||||
int p;
|
||||
|
||||
// sum things up so can reserve space for new vecs
|
||||
for(p=0;p<nPrims;p++) {
|
||||
nOrigTotalVerts+=me->get_length(p);
|
||||
}
|
||||
|
||||
// could compute it exactly if I wanted to reproduce all the cTotalVertsOutputSoFar logic in the loop below
|
||||
// might save on memory reallocations. try to overestimate using *3.
|
||||
int cEstimatedTotalVerts=nOrigTotalVerts+nPrims*3-2;
|
||||
|
||||
#define INIT_ATTRVARS(ATTRNAME,PTA_TYPENAME) \
|
||||
PTA_##PTA_TYPENAME old_##ATTRNAME##s,new_##ATTRNAME##s; \
|
||||
PTA_ushort old_##ATTRNAME##_indices,new_##ATTRNAME##_indices; \
|
||||
GeomBindType ATTRNAME##binding; \
|
||||
me->get_##ATTRNAME##s(old_##ATTRNAME##s, ATTRNAME##binding, old_##ATTRNAME##_indices); \
|
||||
\
|
||||
PTA_##PTA_TYPENAME::iterator old_##ATTRNAME##_iter=old_##ATTRNAME##s.begin(); \
|
||||
PTA_ushort::iterator old_##ATTRNAME##index_iter; \
|
||||
\
|
||||
if((ATTRNAME##binding!=G_OFF)&&(ATTRNAME##binding!=G_OVERALL)) { \
|
||||
if(old_##ATTRNAME##_indices!=NULL) { \
|
||||
old_##ATTRNAME##index_iter=old_##ATTRNAME##_indices.begin(); \
|
||||
new_##ATTRNAME##_indices.reserve(cEstimatedTotalVerts); \
|
||||
} else { \
|
||||
new_##ATTRNAME##s.reserve(cEstimatedTotalVerts); \
|
||||
} \
|
||||
}
|
||||
|
||||
INIT_ATTRVARS(coord,Vertexf);
|
||||
INIT_ATTRVARS(color,Colorf);
|
||||
INIT_ATTRVARS(normal,Normalf);
|
||||
INIT_ATTRVARS(texcoord,TexCoordf);
|
||||
|
||||
#define IsOdd(X) (((X) & 0x1)!=0)
|
||||
|
||||
uint cTotalVertsOutputSoFar=0;
|
||||
int nVerts;
|
||||
bool bAddExtraStartVert;
|
||||
|
||||
for(p=0;p<nPrims;p++) {
|
||||
nVerts=me->get_length(p);
|
||||
|
||||
// if bStripStateStartsBackfacing, then if the current strip
|
||||
// ends frontfacing, we can fix the problem by just reversing
|
||||
// the current strip order. But if the current strip ends
|
||||
// backfacing, this will not work, since last tri is encoded for backfacing slot
|
||||
// so it will be incorrectly backfacing when you put it in a backfacing
|
||||
// slot AND reverse the vtx order.
|
||||
|
||||
// insert an extra pad vertex at the beginning to force the
|
||||
// strip backface-state parity to change (more expensive, since
|
||||
// we make 1 more degen tri). We always want the first tri
|
||||
// to start in a front-facing slot (unless it's a reversed end
|
||||
|
||||
bStripReversalNeeded = false;
|
||||
bAddExtraStartVert=false;
|
||||
|
||||
if(p==0) {
|
||||
cTotalVertsOutputSoFar+=nVerts+1;
|
||||
} else {
|
||||
if(!IsOdd(cTotalVertsOutputSoFar)) {
|
||||
// we're starting on a backfacing slot
|
||||
if(IsOdd(nVerts)) {
|
||||
bStripReversalNeeded = true;
|
||||
} else {
|
||||
bAddExtraStartVert=true;
|
||||
cTotalVertsOutputSoFar++;
|
||||
}
|
||||
}
|
||||
|
||||
cTotalVertsOutputSoFar+=nVerts+2;
|
||||
if(p==nPrims-1)
|
||||
cTotalVertsOutputSoFar--;
|
||||
}
|
||||
|
||||
#define PERVERTEX_ATTRLOOP(OLDVERT_ITERATOR,NEWVERT_VECTOR,VECLENGTH,NUMSTARTPADDINGATTRS,NUMENDPADDINGATTRS) \
|
||||
if(bStripReversalNeeded) { \
|
||||
/* to preserve normal-direction property for backface-cull purposes, */ \
|
||||
/* vtx order must be reversed*/ \
|
||||
\
|
||||
OLDVERT_ITERATOR+=((VECLENGTH)-1); /* start at last vert, and go back*/ \
|
||||
/*dxgsg7_cat.debug() << "doing reversal on strip " << p << " of length " << nVerts << endl;*/ \
|
||||
\
|
||||
if(p!=0) { \
|
||||
/* copy first vert twice to link with last strip*/ \
|
||||
for(int i=0;i<NUMSTARTPADDINGATTRS;i++) \
|
||||
NEWVERT_VECTOR.push_back(*OLDVERT_ITERATOR); \
|
||||
} \
|
||||
\
|
||||
for(int v=0;v<(VECLENGTH);v++,OLDVERT_ITERATOR--) { \
|
||||
NEWVERT_VECTOR.push_back(*OLDVERT_ITERATOR); \
|
||||
} \
|
||||
\
|
||||
OLDVERT_ITERATOR++; \
|
||||
\
|
||||
if(p!=(nPrims-1)) { \
|
||||
/* copy last vert twice to link to next strip */ \
|
||||
for(int i=0;i<NUMENDPADDINGATTRS;i++) \
|
||||
NEWVERT_VECTOR.push_back(*OLDVERT_ITERATOR); \
|
||||
} \
|
||||
\
|
||||
OLDVERT_ITERATOR+=(VECLENGTH); \
|
||||
\
|
||||
} else { \
|
||||
if(p!=0) { \
|
||||
/* copy first vert twice to link with last strip*/ \
|
||||
for(int i=0;i<NUMSTARTPADDINGATTRS;i++) \
|
||||
NEWVERT_VECTOR.push_back(*OLDVERT_ITERATOR); \
|
||||
} \
|
||||
\
|
||||
for(int v=0;v<(VECLENGTH);v++,OLDVERT_ITERATOR++) \
|
||||
NEWVERT_VECTOR.push_back(*OLDVERT_ITERATOR); \
|
||||
\
|
||||
if(p!=(nPrims-1)) { \
|
||||
/* copy last vert twice to link to next strip */ \
|
||||
for(int i=0;i<NUMENDPADDINGATTRS;i++) \
|
||||
NEWVERT_VECTOR.push_back(*(OLDVERT_ITERATOR-1)); \
|
||||
} \
|
||||
}
|
||||
|
||||
|
||||
#define CONVERT_ATTR_VECTOR(ATTRNAME) \
|
||||
switch(ATTRNAME##binding) { \
|
||||
case G_OFF: \
|
||||
case G_OVERALL: \
|
||||
break; \
|
||||
\
|
||||
case G_PER_PRIM: { \
|
||||
/* must convert to per-component*/ \
|
||||
/* nPrims*2+origTotalVerts-2 components */ \
|
||||
int veclength=nVerts+2; \
|
||||
if((p==0)||(p==(nPrims-1))) \
|
||||
veclength--; \
|
||||
if(bAddExtraStartVert) \
|
||||
veclength++; \
|
||||
\
|
||||
if(old_##ATTRNAME##_indices!=NULL) { \
|
||||
for(int v=0;v<veclength;v++) \
|
||||
new_##ATTRNAME##_indices.push_back(*old_##ATTRNAME##index_iter); \
|
||||
\
|
||||
old_##ATTRNAME##index_iter++; /* move on to val for next strip*/ \
|
||||
} else { \
|
||||
for(int v=0;v<veclength;v++) \
|
||||
new_##ATTRNAME##s.push_back(*old_##ATTRNAME##_iter); \
|
||||
\
|
||||
old_##ATTRNAME##_iter++; /* move on to val for next strip*/ \
|
||||
} \
|
||||
break; \
|
||||
} \
|
||||
\
|
||||
case G_PER_COMPONENT: \
|
||||
case G_PER_VERTEX: { \
|
||||
int veclength,numstartcopies,numendcopies; \
|
||||
\
|
||||
if(ATTRNAME##binding==G_PER_VERTEX) { \
|
||||
veclength=nVerts; \
|
||||
numstartcopies=numendcopies=1; \
|
||||
} else { \
|
||||
veclength=nVerts-2; \
|
||||
numstartcopies=numendcopies=2; \
|
||||
} \
|
||||
if(bAddExtraStartVert) \
|
||||
numstartcopies++; \
|
||||
\
|
||||
if(old_##ATTRNAME##_indices!=NULL) { \
|
||||
PERVERTEX_ATTRLOOP(old_##ATTRNAME##index_iter,new_##ATTRNAME##_indices,veclength,numstartcopies,numendcopies); \
|
||||
} else { \
|
||||
/* non-indexed case */ \
|
||||
PERVERTEX_ATTRLOOP(old_##ATTRNAME##_iter,new_##ATTRNAME##s,veclength,numstartcopies,numendcopies); \
|
||||
} \
|
||||
} \
|
||||
break; \
|
||||
} \
|
||||
|
||||
|
||||
CONVERT_ATTR_VECTOR(coord);
|
||||
|
||||
#ifdef _DEBUG
|
||||
if(old_coord_indices==NULL)
|
||||
assert(cTotalVertsOutputSoFar==new_coords.size());
|
||||
else
|
||||
assert(cTotalVertsOutputSoFar==new_coord_indices.size());
|
||||
#endif
|
||||
|
||||
CONVERT_ATTR_VECTOR(color);
|
||||
CONVERT_ATTR_VECTOR(normal);
|
||||
CONVERT_ATTR_VECTOR(texcoord);
|
||||
|
||||
} // end per-Prim (strip) loop
|
||||
|
||||
if(old_coord_indices!=NULL) {
|
||||
me->set_coords(old_coords, new_coord_indices);
|
||||
new_lengths.push_back(new_coord_indices.size());
|
||||
} else {
|
||||
me->set_coords(new_coords);
|
||||
new_lengths.push_back(new_coords.size());
|
||||
}
|
||||
|
||||
me->set_lengths(new_lengths);
|
||||
me->set_num_prims(1);
|
||||
|
||||
#define SET_NEW_ATTRIBS(ATTRNAME) \
|
||||
if((ATTRNAME##binding!=G_OFF) && (ATTRNAME##binding!=G_OVERALL)) { \
|
||||
if(ATTRNAME##binding==G_PER_PRIM) \
|
||||
ATTRNAME##binding=G_PER_COMPONENT; \
|
||||
if(old_##ATTRNAME##_indices==NULL) { \
|
||||
me->set_##ATTRNAME##s(new_##ATTRNAME##s, ATTRNAME##binding); \
|
||||
} else { \
|
||||
me->set_##ATTRNAME##s(old_##ATTRNAME##s, ATTRNAME##binding, new_##ATTRNAME##_indices); \
|
||||
} \
|
||||
}
|
||||
/*
|
||||
int ii;
|
||||
for( ii=0;ii<old_coords.size();ii++)
|
||||
dxgsg7_cat.debug() << "old coord[" << ii <<"] " << old_coords[ii] << endl;
|
||||
dxgsg7_cat.debug() << "=================\n";
|
||||
for(ii=0;ii<new_coords.size();ii++)
|
||||
dxgsg7_cat.debug() << "new coord[" << ii <<"] " << new_coords[ii] << endl;
|
||||
dxgsg7_cat.debug() << "=================\n";
|
||||
|
||||
for( ii=0;ii<old_normals.size();ii++)
|
||||
dxgsg7_cat.debug() << "old norm[" << ii <<"] " << old_normals[ii] << endl;
|
||||
dxgsg7_cat.debug() << "=================\n";
|
||||
for(ii=0;ii<new_normals.size();ii++)
|
||||
dxgsg7_cat.debug() << "new norm[" << ii <<"] " << new_normals[ii] << endl;
|
||||
|
||||
if(old_color_indices!=NULL) {
|
||||
|
||||
for( ii=0;ii<old_color_indices.size();ii++)
|
||||
dxgsg7_cat.debug() << "old colorindex[" << ii <<"] " << old_color_indices[ii] << endl;
|
||||
dxgsg7_cat.debug() << "=================\n";
|
||||
for( ii=0;ii<new_color_indices.size();ii++)
|
||||
dxgsg7_cat.debug() << "new colorindex[" << ii <<"] " << new_color_indices[ii] << endl;
|
||||
}
|
||||
*/
|
||||
|
||||
SET_NEW_ATTRIBS(color);
|
||||
SET_NEW_ATTRIBS(normal);
|
||||
SET_NEW_ATTRIBS(texcoord);
|
||||
|
||||
me->make_dirty();
|
||||
}
|
||||
} // if(link_tristrips)
|
||||
|
||||
// for now, only using vertexbufs for static Geom, so
|
||||
// Make sure we have at least some static Geoms in the GeomNode;
|
||||
int cNumVerts=0,i,num_geoms = node->get_num_geoms();
|
||||
|
||||
// need to always put in space for color because we might have some scene-graph color we need to add?
|
||||
// will that even work? I think we'd have to overwrite all the VB colors dynamically, and then restore
|
||||
// them from somewhere if the global color goes away
|
||||
|
||||
DWORD fvfFlags=D3DFVF_XYZ;// | D3DFVF_DIFFUSE;
|
||||
|
||||
for (i = 0; (i < num_geoms); i++) {
|
||||
dDrawable *drawable1 = node->get_geom(i);
|
||||
if(!drawable1->is_of_type(Geom::get_class_type()))
|
||||
continue;
|
||||
|
||||
Geom *geom=DCAST(Geom, drawable1);
|
||||
assert(geom!=NULL);
|
||||
|
||||
DWORD new_fvfFlags=D3DFVF_XYZ;
|
||||
|
||||
if(!geom->is_dynamic()) {
|
||||
cNumVerts+=geom->get_num_vertices();
|
||||
if(geom->get_binding(G_COLOR) != G_OFF)
|
||||
new_fvfFlags |= D3DFVF_DIFFUSE;
|
||||
if(geom->get_binding(G_NORMAL) != G_OFF)
|
||||
new_fvfFlags |= D3DFVF_NORMAL;
|
||||
if(geom->get_binding(G_TEXCOORD) != G_OFF)
|
||||
new_fvfFlags |= (D3DFVF_TEX1 | D3DFVF_TEXCOORDSIZE2(0));
|
||||
}
|
||||
if(i!=0) {
|
||||
if(fvfFlags!=new_fvfFlags) {
|
||||
// all primitives within a geom must use the same FVF type for the DrawPrim api
|
||||
dxgsg7_cat.error() << "error creating vertex buffer, geoms within geomnode require differing vertex data types!!\n";
|
||||
exit(1);
|
||||
}
|
||||
} else fvfFlags=new_fvfFlags;
|
||||
}
|
||||
|
||||
if(cNumVerts==0) {
|
||||
// Never mind.
|
||||
return (GeomNodeContext *)NULL;
|
||||
}
|
||||
|
||||
if(cNumVerts>D3DMAXNUMVERTICES) {
|
||||
dxgsg7_cat.error() << "geom node contains more than " << D3DMAXNUMVERTICES << " vertices, cant create 1 vertex buffer\n";
|
||||
exit(1);
|
||||
}
|
||||
|
||||
// Ok, we've got something; use it.
|
||||
DXGeomNodeContext7 *dx_gnc = new DXGeomNodeContext7(node);
|
||||
|
||||
assert(dx_gnc!=NULL);
|
||||
|
||||
// right now there is a 1-1 correspondence b/w vertbufs and geomnodecontexts.
|
||||
// later multiple geomnodecontexts will use the same vertbuf
|
||||
|
||||
HRESULT hr;
|
||||
LPDIRECT3D7 pD3D;
|
||||
|
||||
assert(_pScrn->pD3DDevice!=NULL);
|
||||
hr=_pScrn->pD3DDevice->GetDirect3D(&pD3D);
|
||||
assert(!FAILED(hr));
|
||||
LPDIRECT3DVERTEXBUFFER7 pD3DVertexBuffer;
|
||||
DX_DECLARE_CLEAN(D3DVERTEXBUFFERDESC, VBdesc);
|
||||
|
||||
VBdesc.dwCaps = D3DVBCAPS_WRITEONLY;
|
||||
VBdesc.dwCaps |= _pScrn->bIsTNLDevice ? 0x0 : D3DVBCAPS_SYSTEMMEMORY;
|
||||
VBdesc.dwFVF=fvfFlags;
|
||||
VBdesc.dwNumVertices=cNumVerts;
|
||||
|
||||
hr=pD3D->CreateVertexBuffer(&VBdesc,&pD3DVertexBuffer,0x0);
|
||||
if(FAILED(hr)) {
|
||||
dxgsg7_cat.error() << "error creating vertex buffer: " << ConvD3DErrorToString(hr) << endl;
|
||||
delete dx_gnc;
|
||||
exit(1);
|
||||
}
|
||||
|
||||
dx_gnc->_pVB = pD3DVertexBuffer;
|
||||
|
||||
if(!_pScrn->bIsTNLDevice) {
|
||||
// create VB for ProcessVerts to xform to
|
||||
|
||||
fvfFlags&=~D3DFVF_XYZ; // switch to xformed vert type
|
||||
fvfFlags&=~D3DFVF_NORMAL; // xformed verts are also lighted, so no normals allowed
|
||||
fvfFlags|=D3DFVF_XYZRHW;
|
||||
VBdesc.dwFVF=fvfFlags;
|
||||
|
||||
hr=pD3D->CreateVertexBuffer(&VBdesc,&pD3DVertexBuffer,0x0);
|
||||
if(FAILED(hr)) {
|
||||
dxgsg7_cat.error() << "error creating xformed vertex buffer: " << ConvD3DErrorToString(hr) << endl;
|
||||
delete dx_gnc;
|
||||
exit(1);
|
||||
}
|
||||
|
||||
dx_gnc->_pXformed_VB = pD3DVertexBuffer;
|
||||
}
|
||||
|
||||
pD3D->Release();
|
||||
|
||||
dx_gnc->_num_verts=0;
|
||||
dx_gnc->_start_index=0;
|
||||
|
||||
LPVOID pVertData=NULL;
|
||||
DWORD dwVBFlags = DDLOCK_NOOVERWRITE | DDLOCK_NOSYSLOCK | DDLOCK_SURFACEMEMORYPTR |
|
||||
DDLOCK_WAIT | DDLOCK_DISCARDCONTENTS;
|
||||
|
||||
hr=dx_gnc->_pVB->Lock(dwVBFlags,&pVertData,NULL);
|
||||
if(FAILED(hr)) {
|
||||
dxgsg7_cat.error() << "error locking vertex buffer: " << ConvD3DErrorToString(hr) << endl;
|
||||
delete dx_gnc;
|
||||
exit(1);
|
||||
}
|
||||
|
||||
assert(pVertData!=NULL);
|
||||
_pCurrentGeomContext = dx_gnc;
|
||||
_pCurrentGeomContext->_pEndofVertData=(BYTE*)pVertData;
|
||||
_bDrawPrimDoSetupVertexBuffer = true;
|
||||
|
||||
|
||||
for (i = 0; (i < num_geoms); i++) {
|
||||
dDrawable *drawable1 = node->get_geom(i);
|
||||
if(!drawable1->is_of_type(Geom::get_class_type()))
|
||||
continue;
|
||||
|
||||
Geom *geom=DCAST(Geom, drawable1);
|
||||
assert(geom!=NULL);
|
||||
|
||||
if(geom->is_dynamic()) {
|
||||
dx_gnc->_other_geoms.push_back(geom);
|
||||
} else {
|
||||
dx_gnc->_cached_geoms.push_back(geom);
|
||||
node->get_geom(i)->draw(this);
|
||||
}
|
||||
}
|
||||
|
||||
_bDrawPrimDoSetupVertexBuffer = false;
|
||||
_pCurrentGeomContext->_pEndofVertData=NULL;
|
||||
_pCurrentGeomContext = NULL;
|
||||
|
||||
hr=dx_gnc->_pVB->Unlock();
|
||||
if(FAILED(hr)) {
|
||||
dxgsg7_cat.error() << "error unlocking vertex buffer: " << ConvD3DErrorToString(hr) << endl;
|
||||
delete dx_gnc;
|
||||
exit(1);
|
||||
}
|
||||
|
||||
assert(cNumVerts==dx_gnc->_num_verts);
|
||||
|
||||
hr=dx_gnc->_pVB->Optimize(_pScrn->pD3DDevice,0x0);
|
||||
if(FAILED(hr)) {
|
||||
dxgsg7_cat.error() << "error optimizing vertex buffer: " << ConvD3DErrorToString(hr) << endl;
|
||||
delete dx_gnc;
|
||||
exit(1);
|
||||
}
|
||||
|
||||
if(dxgsg7_cat.is_spam())
|
||||
dxgsg7_cat.spam() << "creating vertex buffer of size: " << cNumVerts << endl;
|
||||
|
||||
#if 0 //DO_PSTATS
|
||||
float num_verts_after =
|
||||
_vertices_tristrip_pcollector.get_level() +
|
||||
_vertices_trifan_pcollector.get_level() +
|
||||
_vertices_tri_pcollector.get_level() +
|
||||
_vertices_other_pcollector.get_level();
|
||||
float num_verts = num_verts_after - num_verts_before;
|
||||
ggnc->_num_verts = (int)(num_verts + 0.5);
|
||||
#endif
|
||||
|
||||
bool inserted = mark_prepared_geom_node(dx_gnc);
|
||||
|
||||
// If this assertion fails, the same GeomNode was prepared twice,
|
||||
// which shouldn't be possible, since the GeomNode itself should
|
||||
// detect this.
|
||||
nassertr(inserted, NULL);
|
||||
|
||||
return dx_gnc;
|
||||
#endif // temporarily disabled until ported to new scene graph
|
||||
return NULL;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
// Function: DXGraphicsStateGuardian7::draw_geom_node
|
||||
// Access: Public, Virtual
|
||||
// Description: Draws a GeomNode previously indicated by a call to
|
||||
// prepare_geom_node().
|
||||
////////////////////////////////////////////////////////////////////
|
||||
void DXGraphicsStateGuardian7::
|
||||
draw_geom_node(GeomNode *node, const RenderState *state, GeomNodeContext *gnc) {
|
||||
#if 0 // temporarily disabled until ported to new scene graph
|
||||
|
||||
uint i,num_geoms = node->get_num_geoms();
|
||||
|
||||
if (gnc == (GeomNodeContext *)NULL) {
|
||||
|
||||
// We don't have a saved context; just draw the GeomNode in
|
||||
// immediate mode.
|
||||
for (i = 0; i < num_geoms; i++) {
|
||||
node->get_geom(i)->draw(this);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
// We do have a saved context; use it.
|
||||
add_to_geom_node_record(gnc);
|
||||
DXGeomNodeContext7 *dx_gnc = DCAST(DXGeomNodeContext7, gnc);
|
||||
|
||||
#ifdef _DEBUG
|
||||
assert(dx_gnc->_pVB!=NULL);
|
||||
assert((!_pScrn->bIsTNLDevice)==(dx_gnc->_pXformed_VB!=NULL));
|
||||
#endif
|
||||
|
||||
if(!_pScrn->bIsTNLDevice) {
|
||||
HRESULT hr;
|
||||
|
||||
DWORD PVOp=D3DVOP_CLIP | D3DVOP_TRANSFORM | D3DVOP_EXTENTS;
|
||||
|
||||
D3DVERTEXBUFFERDESC VBdesc;
|
||||
VBdesc.dwSize=sizeof(VBdesc);
|
||||
hr=dx_gnc->_pVB->GetVertexBufferDesc(&VBdesc); // would be useful to keep fvf in vertbuf struct to avoid having to do this
|
||||
if(FAILED(hr)) {
|
||||
dxgsg7_cat.error() << "error in getvbdesc: " << ConvD3DErrorToString(hr) << endl;
|
||||
exit(1);
|
||||
}
|
||||
|
||||
if(_lighting_enabled && (VBdesc.dwFVF & D3DFVF_NORMAL)) {
|
||||
PVOp|=D3DVOP_LIGHT;
|
||||
}
|
||||
|
||||
hr=dx_gnc->_pXformed_VB->ProcessVertices(PVOp,0,dx_gnc->_num_verts,dx_gnc->_pVB,0,_pScrn->pD3DDevice,0x0);
|
||||
if(FAILED(hr)) {
|
||||
dxgsg7_cat.error() << "error in ProcessVertices: " << ConvD3DErrorToString(hr) << endl;
|
||||
exit(1);
|
||||
}
|
||||
|
||||
// disable clipping, since VB is already xformed and clipped
|
||||
if(_clipping_enabled)
|
||||
_pScrn->pD3DDevice->SetRenderState(D3DRENDERSTATE_CLIPPING, false);
|
||||
}
|
||||
|
||||
// assume we need gouraud for now. we can make this more complex to select flat conditionally later
|
||||
set_shademode(D3DSHADE_GOURAUD);
|
||||
int cur_startvert=dx_gnc->_start_index;
|
||||
|
||||
for (i = 0; i < dx_gnc->_cached_geoms.size(); i++) {
|
||||
// I think we can just draw them directly? since cant account for issued stuff (since
|
||||
// its already encoded in the VB), and we can set the renderstates here (e.g. gouraud mode)
|
||||
// dx_gnc->_cached_geoms[i]->draw(this);
|
||||
|
||||
DPInfo *dpi=&dx_gnc->_PrimInfo[i];
|
||||
|
||||
LPDIRECT3DVERTEXBUFFER7 pVB;
|
||||
if(_pScrn->bIsTNLDevice) {
|
||||
pVB=dx_gnc->_pVB;
|
||||
} else {
|
||||
pVB=dx_gnc->_pXformed_VB;
|
||||
}
|
||||
|
||||
HRESULT hr = _pScrn->pD3DDevice->DrawPrimitiveVB(dpi->primtype,pVB,cur_startvert,dpi->nVerts,0x0);
|
||||
TestDrawPrimFailure(DrawPrim,hr,_pScrn->pDD,dpi->nVerts,0);
|
||||
|
||||
cur_startvert+=dpi->nVerts;
|
||||
}
|
||||
|
||||
if((!_pScrn->bIsTNLDevice) && _clipping_enabled)
|
||||
_pScrn->pD3DDevice->SetRenderState(D3DRENDERSTATE_CLIPPING, true);
|
||||
|
||||
// Also draw all the dynamic Geoms.
|
||||
for (i = 0; i < dx_gnc->_other_geoms.size(); i++) {
|
||||
dx_gnc->_other_geoms[i]->draw(this);
|
||||
}
|
||||
|
||||
#if 0 //def DO_PSTATS
|
||||
DO_PSTATS_STUFF(PStatTimer timer(_draw_primitive_pcollector));
|
||||
_vertices_display_list_pcollector.add_level(dx_gnc->_num_verts);
|
||||
#endif
|
||||
#endif // temporarily disabled until ported to new scene graph
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
// Function: DXGraphicsStateGuardian7::release_geom_node
|
||||
// Access: Public, Virtual
|
||||
// Description: Frees the resources previously allocated via a call
|
||||
// to prepare_geom_node(), including deleting the
|
||||
// GeomNodeContext itself, if necessary.
|
||||
////////////////////////////////////////////////////////////////////
|
||||
void DXGraphicsStateGuardian7::
|
||||
release_geom_node(GeomNodeContext *gnc) {
|
||||
#if 0 // temporarily disabled until ported to new scene graph
|
||||
if (gnc != (GeomNodeContext *)NULL) {
|
||||
DXGeomNodeContext7 *dx_gnc = DCAST(DXGeomNodeContext7, gnc);
|
||||
|
||||
bool erased = unmark_prepared_geom_node(dx_gnc);
|
||||
|
||||
// If this assertion fails, a GeomNode was released that hadn't
|
||||
// been prepared (or a GeomNode was released twice).
|
||||
nassertv(erased);
|
||||
|
||||
dx_gnc->_node->clear_gsg(this);
|
||||
delete dx_gnc; // should release vertex buffer
|
||||
}
|
||||
#endif // temporarily disabled until ported to new scene graph
|
||||
}
|
||||
|
@ -22,7 +22,6 @@
|
||||
//#define GSG_VERBOSE 1
|
||||
|
||||
#include "dxgsg7base.h"
|
||||
#include "dxGeomNodeContext7.h"
|
||||
#include "dxTextureContext7.h"
|
||||
#include "config_dxgsg7.h"
|
||||
|
||||
@ -89,11 +88,6 @@ public:
|
||||
virtual void draw_trifan(GeomTrifan *geom, GeomContext *gc);
|
||||
virtual void draw_sphere(GeomSphere *geom, GeomContext *gc);
|
||||
|
||||
virtual GeomNodeContext *prepare_geom_node(GeomNode *node);
|
||||
virtual void draw_geom_node(GeomNode *node, const RenderState *state,
|
||||
GeomNodeContext *gnc);
|
||||
virtual void release_geom_node(GeomNodeContext *gnc);
|
||||
|
||||
virtual TextureContext *prepare_texture(Texture *tex);
|
||||
virtual void apply_texture(TextureContext *tc);
|
||||
virtual void release_texture(TextureContext *tc);
|
||||
@ -246,7 +240,6 @@ protected:
|
||||
D3DSHADEMODE _CurShadeMode;
|
||||
|
||||
bool _bDrawPrimDoSetupVertexBuffer; // if true, draw methods just copy vertex data into pCurrentGeomContext
|
||||
DXGeomNodeContext7 *_pCurrentGeomContext; // used in vertex buffer setup
|
||||
|
||||
// iterators for primitives
|
||||
Geom::VertexIterator vi;
|
||||
|
@ -3,6 +3,5 @@
|
||||
#include "config_dxgsg7.cxx"
|
||||
#include "dxSavedFrameBuffer7.cxx"
|
||||
#include "dxTextureContext7.cxx"
|
||||
#include "dxGeomNodeContext7.cxx"
|
||||
#include "wdxGraphicsPipe7.cxx"
|
||||
#include "wdxGraphicsWindow7.cxx"
|
||||
|
@ -20,7 +20,7 @@
|
||||
// need to install these due to external projects that link directly with libpandadx (bartop)
|
||||
#define INSTALL_HEADERS \
|
||||
dxgsg8base.h config_dxgsg8.h dxGraphicsStateGuardian8.I dxGraphicsStateGuardian8.h \
|
||||
dxTextureContext8.h dxGeomNodeContext8.h dxGeomNodeContext8.I d3dfont8.h \
|
||||
dxTextureContext8.h d3dfont8.h \
|
||||
dxGraphicsDevice8.h
|
||||
|
||||
// build dxGraphicsStateGuardian separately since its so big
|
||||
@ -35,7 +35,6 @@
|
||||
#define INCLUDED_SOURCES \
|
||||
config_dxgsg8.cxx \
|
||||
dxSavedFrameBuffer8.cxx dxTextureContext8.cxx \
|
||||
dxGeomNodeContext8.cxx \
|
||||
d3dfont8.cxx \
|
||||
dxGraphicsDevice8.cxx \
|
||||
wdxGraphicsPipe8.cxx wdxGraphicsWindow8.cxx
|
||||
|
@ -195,7 +195,6 @@ init_libdxgsg8() {
|
||||
DXGraphicsStateGuardian8::init_type();
|
||||
DXSavedFrameBuffer8::init_type();
|
||||
DXTextureContext8::init_type();
|
||||
DXGeomNodeContext8::init_type();
|
||||
|
||||
wdxGraphicsPipe8::init_type();
|
||||
wdxGraphicsWindow8::init_type();
|
||||
|
@ -1,33 +0,0 @@
|
||||
// Filename: dxGeomNodeContext.I
|
||||
// Created by: drose (12Jun01)
|
||||
//
|
||||
////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// PANDA 3D SOFTWARE
|
||||
// Copyright (c) 2001 - 2004, Disney Enterprises, Inc. All rights reserved
|
||||
//
|
||||
// All use of this software is subject to the terms of the Panda 3d
|
||||
// Software license. You should have received a copy of this license
|
||||
// along with this source code; you will also find a current copy of
|
||||
// the license at http://etc.cmu.edu/panda3d/docs/license/ .
|
||||
//
|
||||
// To contact the maintainers of this program write to
|
||||
// panda3d-general@lists.sourceforge.net .
|
||||
//
|
||||
////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
// Function: DXGeomNodeContext8::Constructor
|
||||
// Access: Public
|
||||
// Description:
|
||||
////////////////////////////////////////////////////////////////////
|
||||
INLINE DXGeomNodeContext8::
|
||||
DXGeomNodeContext8(GeomNode *node) : GeomNodeContext(node)
|
||||
{
|
||||
_num_verts = 0;
|
||||
/*
|
||||
_pVB = NULL;
|
||||
_pXformed_VB = NULL;
|
||||
*/
|
||||
}
|
@ -1,35 +0,0 @@
|
||||
// Filename: dxGeomNodeContext.cxx
|
||||
// Created by: drose (12Jun01)
|
||||
//
|
||||
////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// PANDA 3D SOFTWARE
|
||||
// Copyright (c) 2001 - 2004, Disney Enterprises, Inc. All rights reserved
|
||||
//
|
||||
// All use of this software is subject to the terms of the Panda 3d
|
||||
// Software license. You should have received a copy of this license
|
||||
// along with this source code; you will also find a current copy of
|
||||
// the license at http://etc.cmu.edu/panda3d/docs/license/ .
|
||||
//
|
||||
// To contact the maintainers of this program write to
|
||||
// panda3d-general@lists.sourceforge.net .
|
||||
//
|
||||
////////////////////////////////////////////////////////////////////
|
||||
|
||||
#include "dxGeomNodeContext8.h"
|
||||
|
||||
TypeHandle DXGeomNodeContext8::_type_handle;
|
||||
|
||||
DXGeomNodeContext8::~DXGeomNodeContext8()
|
||||
{
|
||||
/*
|
||||
if(_pXformed_VB!=NULL)
|
||||
_pXformed_VB->Release();
|
||||
_pXformed_VB=NULL;
|
||||
|
||||
if(_pVB!=NULL)
|
||||
_pVB->Release();
|
||||
_pVB=NULL;
|
||||
*/
|
||||
}
|
||||
|
@ -1,89 +0,0 @@
|
||||
// Filename: dxGeomNodeContext8.h
|
||||
// Created by: drose (12Jun01)
|
||||
//
|
||||
////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// PANDA 3D SOFTWARE
|
||||
// Copyright (c) 2001 - 2004, Disney Enterprises, Inc. All rights reserved
|
||||
//
|
||||
// All use of this software is subject to the terms of the Panda 3d
|
||||
// Software license. You should have received a copy of this license
|
||||
// along with this source code; you will also find a current copy of
|
||||
// the license at http://etc.cmu.edu/panda3d/docs/license/ .
|
||||
//
|
||||
// To contact the maintainers of this program write to
|
||||
// panda3d-general@lists.sourceforge.net .
|
||||
//
|
||||
////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef DXGEOMNODECONTEXT8_H
|
||||
#define DXGEOMNODECONTEXT8_H
|
||||
|
||||
#include "dxgsg8base.h"
|
||||
|
||||
#include "geomNodeContext.h"
|
||||
#include "geomNode.h"
|
||||
#include "pvector.h"
|
||||
|
||||
typedef struct {
|
||||
DWORD nVerts;
|
||||
D3DPRIMITIVETYPE primtype;
|
||||
} DPInfo;
|
||||
|
||||
// empty shell unimplemented for DX8 right now
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
// Class : DXGeomNodeContext8
|
||||
// Description :
|
||||
////////////////////////////////////////////////////////////////////
|
||||
class EXPCL_PANDADX DXGeomNodeContext8 : public GeomNodeContext {
|
||||
public:
|
||||
INLINE DXGeomNodeContext8(GeomNode *node);
|
||||
~DXGeomNodeContext8();
|
||||
|
||||
// A list of the dynamic Geoms within the GeomNode; these aren't
|
||||
// part of the above display list and must be drawn separately
|
||||
typedef pvector< PT(Geom) > Geoms;
|
||||
Geoms _cached_geoms,_other_geoms;
|
||||
|
||||
// VB's are already reference-counted by D3D, no need to make separate panda object to do that
|
||||
// but we will want a way to know if VB has already been xformed by ProcessVerts this frame
|
||||
// if multiple geomnodes share VBs
|
||||
|
||||
/* unimplemented right now
|
||||
LPDIRECT3DVERTEXBUFFER7 _pVB;
|
||||
LPDIRECT3DVERTEXBUFFER7 _pXformed_VB;
|
||||
*/
|
||||
|
||||
|
||||
int _start_index; // starting offset of this geom's verts within the VB
|
||||
int _num_verts; // number of verts used by this geomcontext within the VB
|
||||
|
||||
BYTE *_pEndofVertData; // ptr to end of current vert data in VB (note: only used/valid during setup)
|
||||
|
||||
// for multiple geoms per VB, either will have to regen lengths based on per* flags, or store
|
||||
// per geom vector of perprim vectors lengths
|
||||
vector<DPInfo> _PrimInfo;
|
||||
|
||||
public:
|
||||
static TypeHandle get_class_type() {
|
||||
return _type_handle;
|
||||
}
|
||||
static void init_type() {
|
||||
GeomNodeContext::init_type();
|
||||
register_type(_type_handle, "DXGeomNodeContext8",
|
||||
GeomNodeContext::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;
|
||||
};
|
||||
|
||||
#include "dxGeomNodeContext8.I"
|
||||
|
||||
#endif
|
||||
|
@ -5075,45 +5075,6 @@ HRESULT SetViewMatrix( D3DMATRIX& mat, D3DXVECTOR3& vFrom, D3DXVECTOR3& vAt,
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
// Function: DXGraphicsStateGuardian8::prepare_geom_node
|
||||
// Access: Public, Virtual
|
||||
// Description: Prepares the indicated GeomNode for retained-mode
|
||||
// rendering. If this function returns non-NULL, the
|
||||
// value returned will be passed back to a future call
|
||||
// to draw_geom_node(), which is expected to draw the
|
||||
// contents of the node.
|
||||
////////////////////////////////////////////////////////////////////
|
||||
GeomNodeContext *DXGraphicsStateGuardian8::
|
||||
prepare_geom_node(GeomNode *node) {
|
||||
dxgsg8_cat.error() << "prepare_geom_node unimplemented for DX8!\n";
|
||||
return NULL;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
// Function: DXGraphicsStateGuardian8::draw_geom_node
|
||||
// Access: Public, Virtual
|
||||
// Description: Draws a GeomNode previously indicated by a call to
|
||||
// prepare_geom_node().
|
||||
////////////////////////////////////////////////////////////////////
|
||||
void DXGraphicsStateGuardian8::
|
||||
draw_geom_node(GeomNode *node, const RenderState *state,
|
||||
GeomNodeContext *gnc) {
|
||||
return; // unimplemented
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
// Function: DXGraphicsStateGuardian8::release_geom_node
|
||||
// Access: Public, Virtual
|
||||
// Description: Frees the resources previously allocated via a call
|
||||
// to prepare_geom_node(), including deleting the
|
||||
// GeomNodeContext itself, if necessary.
|
||||
////////////////////////////////////////////////////////////////////
|
||||
void DXGraphicsStateGuardian8::
|
||||
release_geom_node(GeomNodeContext *gnc) {
|
||||
}
|
||||
|
||||
HRESULT CreateDX8Cursor(LPDIRECT3DDEVICE8 pd3dDevice, HCURSOR hCursor,BOOL bAddWatermark) {
|
||||
// copied directly from dxsdk SetDeviceCursor
|
||||
HRESULT hr = E_FAIL;
|
||||
|
@ -22,7 +22,6 @@
|
||||
//#define GSG_VERBOSE 1
|
||||
|
||||
#include "dxgsg8base.h"
|
||||
#include "dxGeomNodeContext8.h"
|
||||
#include "dxTextureContext8.h"
|
||||
#include "d3dfont8.h"
|
||||
#include "config_dxgsg8.h"
|
||||
@ -93,11 +92,6 @@ public:
|
||||
virtual void draw_trifan(GeomTrifan *geom, GeomContext *gc);
|
||||
virtual void draw_sphere(GeomSphere *geom, GeomContext *gc);
|
||||
|
||||
virtual GeomNodeContext *prepare_geom_node(GeomNode *node);
|
||||
virtual void draw_geom_node(GeomNode *node, const RenderState *state,
|
||||
GeomNodeContext *gnc);
|
||||
virtual void release_geom_node(GeomNodeContext *gnc);
|
||||
|
||||
virtual TextureContext *prepare_texture(Texture *tex);
|
||||
virtual void apply_texture(TextureContext *tc);
|
||||
virtual void release_texture(TextureContext *tc);
|
||||
@ -248,7 +242,6 @@ protected:
|
||||
bool _bGouraudShadingOn;
|
||||
UINT _color_writemask;
|
||||
bool _bDrawPrimDoSetupVertexBuffer; // if true, draw methods just copy vertex data into pCurrentGeomContext
|
||||
DXGeomNodeContext8 *_pCurrentGeomContext; // used in vertex buffer setup
|
||||
|
||||
// iterators for primitives
|
||||
Geom::VertexIterator vi;
|
||||
|
@ -2,7 +2,6 @@
|
||||
#include "config_dxgsg8.cxx"
|
||||
#include "dxSavedFrameBuffer8.cxx"
|
||||
#include "dxTextureContext8.cxx"
|
||||
#include "dxGeomNodeContext8.cxx"
|
||||
#include "d3dfont8.cxx"
|
||||
#include "wdxGraphicsPipe8.cxx"
|
||||
#include "wdxGraphicsWindow8.cxx"
|
||||
|
@ -18,7 +18,7 @@
|
||||
// need to install these due to external projects that link directly with libpandadx (bartop)
|
||||
#define INSTALL_HEADERS \
|
||||
dxgsg9base.h config_dxgsg9.h dxGraphicsStateGuardian9.I dxGraphicsStateGuardian9.h \
|
||||
dxTextureContext9.h dxGeomNodeContext9.h dxGeomNodeContext9.I d3dfont9.h \
|
||||
dxTextureContext9.h d3dfont9.h \
|
||||
dxGraphicsDevice9.h
|
||||
|
||||
// build dxGraphicsStateGuardian separately since its so big
|
||||
@ -33,7 +33,6 @@
|
||||
#define INCLUDED_SOURCES \
|
||||
config_dxgsg9.cxx \
|
||||
dxSavedFrameBuffer9.cxx dxTextureContext9.cxx \
|
||||
dxGeomNodeContext9.cxx \
|
||||
d3dfont9.cxx \
|
||||
dxGraphicsDevice9.cxx \
|
||||
wdxGraphicsPipe9.cxx wdxGraphicsWindow9.cxx
|
||||
|
@ -195,7 +195,6 @@ init_libdxgsg9() {
|
||||
DXGraphicsStateGuardian9::init_type();
|
||||
DXSavedFrameBuffer9::init_type();
|
||||
DXTextureContext9::init_type();
|
||||
DXGeomNodeContext9::init_type();
|
||||
|
||||
wdxGraphicsPipe9::init_type();
|
||||
wdxGraphicsWindow9::init_type();
|
||||
|
@ -1,33 +0,0 @@
|
||||
// Filename: dxGeomNodeContext.I
|
||||
// Created by: masad (02Jan04)
|
||||
//
|
||||
////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// PANDA 3D SOFTWARE
|
||||
// Copyright (c) 2004, Disney Enterprises, Inc. All rights reserved
|
||||
//
|
||||
// All use of this software is subject to the terms of the Panda 3d
|
||||
// Software license. You should have received a copy of this license
|
||||
// along with this source code; you will also find a current copy of
|
||||
// the license at http://etc.cmu.edu/panda3d/docs/license/ .
|
||||
//
|
||||
// To contact the maintainers of this program write to
|
||||
// panda3d-general@lists.sourceforge.net .
|
||||
//
|
||||
////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
// Function: DXGeomNodeContext9::Constructor
|
||||
// Access: Public
|
||||
// Description:
|
||||
////////////////////////////////////////////////////////////////////
|
||||
INLINE DXGeomNodeContext9::
|
||||
DXGeomNodeContext9(GeomNode *node) : GeomNodeContext(node)
|
||||
{
|
||||
_num_verts = 0;
|
||||
/*
|
||||
_pVB = NULL;
|
||||
_pXformed_VB = NULL;
|
||||
*/
|
||||
}
|
@ -1,35 +0,0 @@
|
||||
// Filename: dxGeomNodeContext.cxx
|
||||
// Created by: masad (02Jan04)
|
||||
//
|
||||
////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// PANDA 3D SOFTWARE
|
||||
// Copyright (c) 2004, Disney Enterprises, Inc. All rights reserved
|
||||
//
|
||||
// All use of this software is subject to the terms of the Panda 3d
|
||||
// Software license. You should have received a copy of this license
|
||||
// along with this source code; you will also find a current copy of
|
||||
// the license at http://etc.cmu.edu/panda3d/docs/license/ .
|
||||
//
|
||||
// To contact the maintainers of this program write to
|
||||
// panda3d-general@lists.sourceforge.net .
|
||||
//
|
||||
////////////////////////////////////////////////////////////////////
|
||||
|
||||
#include "dxGeomNodeContext9.h"
|
||||
|
||||
TypeHandle DXGeomNodeContext9::_type_handle;
|
||||
|
||||
DXGeomNodeContext9::~DXGeomNodeContext9()
|
||||
{
|
||||
/*
|
||||
if(_pXformed_VB!=NULL)
|
||||
_pXformed_VB->Release();
|
||||
_pXformed_VB=NULL;
|
||||
|
||||
if(_pVB!=NULL)
|
||||
_pVB->Release();
|
||||
_pVB=NULL;
|
||||
*/
|
||||
}
|
||||
|
@ -1,89 +0,0 @@
|
||||
// Filename: dxGeomNodeContext8.h
|
||||
// Created by: masad (02Jan04)
|
||||
//
|
||||
////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// PANDA 3D SOFTWARE
|
||||
// Copyright (c) 2004, Disney Enterprises, Inc. All rights reserved
|
||||
//
|
||||
// All use of this software is subject to the terms of the Panda 3d
|
||||
// Software license. You should have received a copy of this license
|
||||
// along with this source code; you will also find a current copy of
|
||||
// the license at http://etc.cmu.edu/panda3d/docs/license/ .
|
||||
//
|
||||
// To contact the maintainers of this program write to
|
||||
// panda3d-general@lists.sourceforge.net .
|
||||
//
|
||||
////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef DXGEOMNODECONTEXT9_H
|
||||
#define DXGEOMNODECONTEXT9_H
|
||||
|
||||
#include "dxgsg9base.h"
|
||||
|
||||
#include "geomNodeContext.h"
|
||||
#include "geomNode.h"
|
||||
#include "pvector.h"
|
||||
|
||||
typedef struct {
|
||||
DWORD nVerts;
|
||||
D3DPRIMITIVETYPE primtype;
|
||||
} DPInfo;
|
||||
|
||||
// empty shell unimplemented for DX9 right now
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
// Class : DXGeomNodeContext9
|
||||
// Description :
|
||||
////////////////////////////////////////////////////////////////////
|
||||
class EXPCL_PANDADX DXGeomNodeContext9 : public GeomNodeContext {
|
||||
public:
|
||||
INLINE DXGeomNodeContext9(GeomNode *node);
|
||||
~DXGeomNodeContext9();
|
||||
|
||||
// A list of the dynamic Geoms within the GeomNode; these aren't
|
||||
// part of the above display list and must be drawn separately
|
||||
typedef pvector< PT(Geom) > Geoms;
|
||||
Geoms _cached_geoms,_other_geoms;
|
||||
|
||||
// VB's are already reference-counted by D3D, no need to make separate panda object to do that
|
||||
// but we will want a way to know if VB has already been xformed by ProcessVerts this frame
|
||||
// if multiple geomnodes share VBs
|
||||
|
||||
/* unimplemented right now
|
||||
LPDIRECT3DVERTEXBUFFER7 _pVB;
|
||||
LPDIRECT3DVERTEXBUFFER7 _pXformed_VB;
|
||||
*/
|
||||
|
||||
|
||||
int _start_index; // starting offset of this geom's verts within the VB
|
||||
int _num_verts; // number of verts used by this geomcontext within the VB
|
||||
|
||||
BYTE *_pEndofVertData; // ptr to end of current vert data in VB (note: only used/valid during setup)
|
||||
|
||||
// for multiple geoms per VB, either will have to regen lengths based on per* flags, or store
|
||||
// per geom vector of perprim vectors lengths
|
||||
vector<DPInfo> _PrimInfo;
|
||||
|
||||
public:
|
||||
static TypeHandle get_class_type() {
|
||||
return _type_handle;
|
||||
}
|
||||
static void init_type() {
|
||||
GeomNodeContext::init_type();
|
||||
register_type(_type_handle, "DXGeomNodeContext9",
|
||||
GeomNodeContext::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;
|
||||
};
|
||||
|
||||
#include "dxGeomNodeContext9.I"
|
||||
|
||||
#endif
|
||||
|
@ -5076,44 +5076,6 @@ HRESULT SetViewMatrix( D3DMATRIX& mat, D3DXVECTOR3& vFrom, D3DXVECTOR3& vAt,
|
||||
#endif
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
// Function: DXGraphicsStateGuardian9::prepare_geom_node
|
||||
// Access: Public, Virtual
|
||||
// Description: Prepares the indicated GeomNode for retained-mode
|
||||
// rendering. If this function returns non-NULL, the
|
||||
// value returned will be passed back to a future call
|
||||
// to draw_geom_node(), which is expected to draw the
|
||||
// contents of the node.
|
||||
////////////////////////////////////////////////////////////////////
|
||||
GeomNodeContext *DXGraphicsStateGuardian9::
|
||||
prepare_geom_node(GeomNode *node) {
|
||||
dxgsg9_cat.error() << "prepare_geom_node unimplemented for DX9!\n";
|
||||
return NULL;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
// Function: DXGraphicsStateGuardian9::draw_geom_node
|
||||
// Access: Public, Virtual
|
||||
// Description: Draws a GeomNode previously indicated by a call to
|
||||
// prepare_geom_node().
|
||||
////////////////////////////////////////////////////////////////////
|
||||
void DXGraphicsStateGuardian9::
|
||||
draw_geom_node(GeomNode *node, const RenderState *state,
|
||||
GeomNodeContext *gnc) {
|
||||
return; // unimplemented
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
// Function: DXGraphicsStateGuardian9::release_geom_node
|
||||
// Access: Public, Virtual
|
||||
// Description: Frees the resources previously allocated via a call
|
||||
// to prepare_geom_node(), including deleting the
|
||||
// GeomNodeContext itself, if necessary.
|
||||
////////////////////////////////////////////////////////////////////
|
||||
void DXGraphicsStateGuardian9::
|
||||
release_geom_node(GeomNodeContext *gnc) {
|
||||
}
|
||||
|
||||
HRESULT CreateDX9Cursor(LPDIRECT3DDEVICE9 pd3dDevice, HCURSOR hCursor,BOOL bAddWatermark) {
|
||||
// copied directly from dxsdk SetDeviceCursor
|
||||
HRESULT hr = E_FAIL;
|
||||
|
@ -22,7 +22,6 @@
|
||||
//#define GSG_VERBOSE 1
|
||||
|
||||
#include "dxgsg9base.h"
|
||||
#include "dxGeomNodeContext9.h"
|
||||
#include "dxTextureContext9.h"
|
||||
#include "d3dfont9.h"
|
||||
#include "config_dxgsg9.h"
|
||||
@ -93,11 +92,6 @@ public:
|
||||
virtual void draw_trifan(GeomTrifan *geom, GeomContext *gc);
|
||||
virtual void draw_sphere(GeomSphere *geom, GeomContext *gc);
|
||||
|
||||
virtual GeomNodeContext *prepare_geom_node(GeomNode *node);
|
||||
virtual void draw_geom_node(GeomNode *node, const RenderState *state,
|
||||
GeomNodeContext *gnc);
|
||||
virtual void release_geom_node(GeomNodeContext *gnc);
|
||||
|
||||
virtual TextureContext *prepare_texture(Texture *tex);
|
||||
virtual void apply_texture(TextureContext *tc);
|
||||
virtual void release_texture(TextureContext *tc);
|
||||
@ -248,7 +242,6 @@ protected:
|
||||
bool _bGouraudShadingOn;
|
||||
UINT _color_writemask;
|
||||
bool _bDrawPrimDoSetupVertexBuffer; // if true, draw methods just copy vertex data into pCurrentGeomContext
|
||||
DXGeomNodeContext9 *_pCurrentGeomContext; // used in vertex buffer setup
|
||||
|
||||
// iterators for primitives
|
||||
Geom::VertexIterator vi;
|
||||
|
@ -2,7 +2,6 @@
|
||||
#include "config_dxgsg9.cxx"
|
||||
#include "dxSavedFrameBuffer9.cxx"
|
||||
#include "dxTextureContext9.cxx"
|
||||
#include "dxGeomNodeContext9.cxx"
|
||||
#include "d3dfont9.cxx"
|
||||
#include "wdxGraphicsPipe9.cxx"
|
||||
#include "wdxGraphicsWindow9.cxx"
|
||||
|
@ -15,6 +15,9 @@
|
||||
glstuff_src.cxx \
|
||||
glstuff_src.h \
|
||||
glstuff_undef_src.h \
|
||||
glGeomContext_src.cxx \
|
||||
glGeomContext_src.I \
|
||||
glGeomContext_src.h \
|
||||
glGraphicsStateGuardian_src.cxx \
|
||||
glGraphicsStateGuardian_src.I \
|
||||
glGraphicsStateGuardian_src.h \
|
||||
@ -23,10 +26,7 @@
|
||||
glSavedFrameBuffer_src.h \
|
||||
glTextureContext_src.cxx \
|
||||
glTextureContext_src.I \
|
||||
glTextureContext_src.h \
|
||||
glGeomNodeContext_src.cxx \
|
||||
glGeomNodeContext_src.I \
|
||||
glGeomNodeContext_src.h
|
||||
glTextureContext_src.h
|
||||
|
||||
#define SOURCES \
|
||||
$[INSTALL_HEADERS] glpure.cxx
|
||||
|
@ -1,5 +1,5 @@
|
||||
// Filename: chromium.GeomNodeContext.I
|
||||
// Created by: drose (12Jun01)
|
||||
// Filename: glGeomContext_src.I
|
||||
// Created by: drose (19Mar04)
|
||||
//
|
||||
////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
@ -18,14 +18,16 @@
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
// Function: CRGeomNodeContext::Constructor
|
||||
// Function: CLP(GeomContext)::Constructor
|
||||
// Access: Public
|
||||
// Description:
|
||||
////////////////////////////////////////////////////////////////////
|
||||
INLINE CRGeomNodeContext::
|
||||
CRGeomNodeContext(GeomNode *node) :
|
||||
GeomNodeContext(node)
|
||||
INLINE CLP(GeomContext)::
|
||||
CLP(GeomContext)(Geom *geom) :
|
||||
GeomContext(geom)
|
||||
{
|
||||
_index = 0;
|
||||
DO_PSTATS_STUFF(_num_verts = 0;)
|
||||
#ifdef DO_PSTATS
|
||||
_num_verts = 0;
|
||||
#endif
|
||||
}
|
@ -1,5 +1,5 @@
|
||||
// Filename: glGeomNodeContext_src.cxx
|
||||
// Created by: drose (12Jun01)
|
||||
// Filename: glGeomContext_src.cxx
|
||||
// Created by: drose (19Mar04)
|
||||
//
|
||||
////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
@ -16,4 +16,5 @@
|
||||
//
|
||||
////////////////////////////////////////////////////////////////////
|
||||
|
||||
TypeHandle CLP(GeomNodeContext)::_type_handle;
|
||||
TypeHandle CLP(GeomContext)::_type_handle;
|
||||
|
@ -1,5 +1,5 @@
|
||||
// Filename: chromium.SavedFrameBuffer.h
|
||||
// Created by: drose (06Oct99)
|
||||
// Filename: glGeomContext_src.h
|
||||
// Created by: drose (19Mar04)
|
||||
//
|
||||
////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
@ -16,38 +16,34 @@
|
||||
//
|
||||
////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef CRSAVEDFRAMEBUFFER_H
|
||||
#define CRSAVEDFRAMEBUFFER_H
|
||||
|
||||
#include "pandabase.h"
|
||||
|
||||
#include "savedFrameBuffer.h"
|
||||
#include "texture.h"
|
||||
#include "textureContext.h"
|
||||
#include "pixelBuffer.h"
|
||||
|
||||
#include "geomContext.h"
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
// Class : CRSavedFrameBuffer
|
||||
// Class : GLGeomContext
|
||||
// Description :
|
||||
////////////////////////////////////////////////////////////////////
|
||||
class EXPCL_PANDACR CRSavedFrameBuffer : public SavedFrameBuffer {
|
||||
class EXPCL_GL CLP(GeomContext) : public GeomContext {
|
||||
public:
|
||||
INLINE CRSavedFrameBuffer(const RenderBuffer &buffer,
|
||||
CPT(DisplayRegion) dr);
|
||||
INLINE ~CRSavedFrameBuffer();
|
||||
INLINE CLP(GeomContext)(Geom *geom);
|
||||
|
||||
PT(Texture) _back_rgba;
|
||||
PT(PixelBuffer) _depth;
|
||||
// This is the GL display list index.
|
||||
GLuint _index;
|
||||
|
||||
// The number of vertices encoded in the display list, for stats
|
||||
// reporting.
|
||||
#ifdef DO_PSTATS
|
||||
int _num_verts;
|
||||
#endif
|
||||
|
||||
public:
|
||||
static TypeHandle get_class_type() {
|
||||
return _type_handle;
|
||||
}
|
||||
static void init_type() {
|
||||
SavedFrameBuffer::init_type();
|
||||
register_type(_type_handle, "CRSavedFrameBuffer",
|
||||
SavedFrameBuffer::get_class_type());
|
||||
GeomContext::init_type();
|
||||
register_type(_type_handle, CLASSPREFIX_QUOTED "GeomContext",
|
||||
GeomContext::get_class_type());
|
||||
}
|
||||
virtual TypeHandle get_type() const {
|
||||
return get_class_type();
|
||||
@ -58,7 +54,5 @@ private:
|
||||
static TypeHandle _type_handle;
|
||||
};
|
||||
|
||||
#include "crSavedFrameBuffer.I"
|
||||
|
||||
#endif
|
||||
#include "glGeomContext_src.I"
|
||||
|
@ -1,31 +0,0 @@
|
||||
// Filename: glGeomNodeContext_src.I
|
||||
// Created by: drose (12Jun01)
|
||||
//
|
||||
////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// PANDA 3D SOFTWARE
|
||||
// Copyright (c) 2001 - 2004, Disney Enterprises, Inc. All rights reserved
|
||||
//
|
||||
// All use of this software is subject to the terms of the Panda 3d
|
||||
// Software license. You should have received a copy of this license
|
||||
// along with this source code; you will also find a current copy of
|
||||
// the license at http://etc.cmu.edu/panda3d/docs/license/ .
|
||||
//
|
||||
// To contact the maintainers of this program write to
|
||||
// panda3d-general@lists.sourceforge.net .
|
||||
//
|
||||
////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
// Function: CLP(GeomNodeContext)::Constructor
|
||||
// Access: Public
|
||||
// Description:
|
||||
////////////////////////////////////////////////////////////////////
|
||||
INLINE CLP(GeomNodeContext)::
|
||||
CLP(GeomNodeContext)(GeomNode *node) :
|
||||
GeomNodeContext(node)
|
||||
{
|
||||
_index = 0;
|
||||
DO_PSTATS_STUFF(_num_verts = 0;)
|
||||
}
|
@ -1,63 +0,0 @@
|
||||
// Filename: glGeomNodeContext_src.h
|
||||
// Created by: drose (12Jun01)
|
||||
//
|
||||
////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// PANDA 3D SOFTWARE
|
||||
// Copyright (c) 2001 - 2004, Disney Enterprises, Inc. All rights reserved
|
||||
//
|
||||
// All use of this software is subject to the terms of the Panda 3d
|
||||
// Software license. You should have received a copy of this license
|
||||
// along with this source code; you will also find a current copy of
|
||||
// the license at http://etc.cmu.edu/panda3d/docs/license/ .
|
||||
//
|
||||
// To contact the maintainers of this program write to
|
||||
// panda3d-general@lists.sourceforge.net .
|
||||
//
|
||||
////////////////////////////////////////////////////////////////////
|
||||
|
||||
#include "pandabase.h"
|
||||
#include "geomNodeContext.h"
|
||||
#include "geomNode.h"
|
||||
#include "pvector.h"
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
// Class : GLGeomNodeContext
|
||||
// Description :
|
||||
////////////////////////////////////////////////////////////////////
|
||||
class EXPCL_GL CLP(GeomNodeContext) : public GeomNodeContext {
|
||||
public:
|
||||
INLINE CLP(GeomNodeContext)(GeomNode *node);
|
||||
|
||||
// The GL display list index that draws the contents of this
|
||||
// GeomNode.
|
||||
GLuint _index;
|
||||
|
||||
// A list of the dynamic Geoms within the GeomNode; these aren't
|
||||
// part of the above display list.
|
||||
typedef pvector< PT(Geom) > Geoms;
|
||||
Geoms _dynamic_geoms;
|
||||
|
||||
// The number of vertices represented by the display list. This is
|
||||
// strictly for the benefit of PStats reporting.
|
||||
DO_PSTATS_STUFF(int _num_verts;)
|
||||
|
||||
public:
|
||||
static TypeHandle get_class_type() {
|
||||
return _type_handle;
|
||||
}
|
||||
static void init_type() {
|
||||
GeomNodeContext::init_type();
|
||||
register_type(_type_handle, CLASSPREFIX_QUOTED "GeomNodeContext",
|
||||
GeomNodeContext::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;
|
||||
};
|
||||
|
||||
#include "glGeomNodeContext_src.I"
|
@ -612,6 +612,8 @@ begin_frame() {
|
||||
return false;
|
||||
}
|
||||
|
||||
_vertices_display_list_pcollector.clear_level();
|
||||
|
||||
report_my_gl_errors();
|
||||
return true;
|
||||
}
|
||||
@ -645,10 +647,23 @@ end_frame() {
|
||||
// Description:
|
||||
////////////////////////////////////////////////////////////////////
|
||||
void CLP(GraphicsStateGuardian)::
|
||||
draw_point(GeomPoint *geom, GeomContext *) {
|
||||
draw_point(GeomPoint *geom, GeomContext *gc) {
|
||||
#ifdef GSG_VERBOSE
|
||||
GLCAT.spam() << "draw_point()" << endl;
|
||||
#endif
|
||||
|
||||
if (gc != (GeomContext *)NULL) {
|
||||
_draw_primitive_pcollector.start();
|
||||
CLP(GeomContext) *ggc = DCAST(CLP(GeomContext), gc);
|
||||
GLP(CallList)(ggc->_index);
|
||||
#ifdef DO_PSTATS
|
||||
_vertices_display_list_pcollector.add_level(ggc->_num_verts);
|
||||
#endif
|
||||
_draw_primitive_pcollector.stop();
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
#ifdef DO_PSTATS
|
||||
PStatTimer timer(_draw_primitive_pcollector);
|
||||
_vertices_other_pcollector.add_level(geom->get_num_vertices());
|
||||
@ -705,10 +720,22 @@ draw_point(GeomPoint *geom, GeomContext *) {
|
||||
// Description:
|
||||
////////////////////////////////////////////////////////////////////
|
||||
void CLP(GraphicsStateGuardian)::
|
||||
draw_line(GeomLine *geom, GeomContext *) {
|
||||
draw_line(GeomLine *geom, GeomContext *gc) {
|
||||
#ifdef GSG_VERBOSE
|
||||
GLCAT.spam() << "draw_line()" << endl;
|
||||
#endif
|
||||
|
||||
if (gc != (GeomContext *)NULL) {
|
||||
_draw_primitive_pcollector.start();
|
||||
CLP(GeomContext) *ggc = DCAST(CLP(GeomContext), gc);
|
||||
GLP(CallList)(ggc->_index);
|
||||
#ifdef DO_PSTATS
|
||||
_vertices_display_list_pcollector.add_level(ggc->_num_verts);
|
||||
#endif
|
||||
_draw_primitive_pcollector.stop();
|
||||
return;
|
||||
}
|
||||
|
||||
#ifdef DO_PSTATS
|
||||
PStatTimer timer(_draw_primitive_pcollector);
|
||||
_vertices_other_pcollector.add_level(geom->get_num_vertices());
|
||||
@ -776,11 +803,22 @@ draw_line(GeomLine *geom, GeomContext *) {
|
||||
// Description:
|
||||
////////////////////////////////////////////////////////////////////
|
||||
void CLP(GraphicsStateGuardian)::
|
||||
draw_linestrip(GeomLinestrip *geom, GeomContext *) {
|
||||
draw_linestrip(GeomLinestrip *geom, GeomContext *gc) {
|
||||
#ifdef GSG_VERBOSE
|
||||
GLCAT.spam() << "draw_linestrip()" << endl;
|
||||
#endif
|
||||
|
||||
if (gc != (GeomContext *)NULL) {
|
||||
_draw_primitive_pcollector.start();
|
||||
CLP(GeomContext) *ggc = DCAST(CLP(GeomContext), gc);
|
||||
GLP(CallList)(ggc->_index);
|
||||
#ifdef DO_PSTATS
|
||||
_vertices_display_list_pcollector.add_level(ggc->_num_verts);
|
||||
#endif
|
||||
_draw_primitive_pcollector.stop();
|
||||
return;
|
||||
}
|
||||
|
||||
#ifdef DO_PSTATS
|
||||
// PStatTimer timer(_draw_primitive_pcollector);
|
||||
// Using PStatTimer may cause a compiler crash.
|
||||
@ -1147,11 +1185,22 @@ draw_sprite(GeomSprite *geom, GeomContext *) {
|
||||
// Description:
|
||||
////////////////////////////////////////////////////////////////////
|
||||
void CLP(GraphicsStateGuardian)::
|
||||
draw_polygon(GeomPolygon *geom, GeomContext *) {
|
||||
draw_polygon(GeomPolygon *geom, GeomContext *gc) {
|
||||
#ifdef GSG_VERBOSE
|
||||
GLCAT.spam() << "draw_polygon()" << endl;
|
||||
#endif
|
||||
|
||||
if (gc != (GeomContext *)NULL) {
|
||||
_draw_primitive_pcollector.start();
|
||||
CLP(GeomContext) *ggc = DCAST(CLP(GeomContext), gc);
|
||||
GLP(CallList)(ggc->_index);
|
||||
#ifdef DO_PSTATS
|
||||
_vertices_display_list_pcollector.add_level(ggc->_num_verts);
|
||||
#endif
|
||||
_draw_primitive_pcollector.stop();
|
||||
return;
|
||||
}
|
||||
|
||||
#ifdef DO_PSTATS
|
||||
// PStatTimer timer(_draw_primitive_pcollector);
|
||||
// Using PStatTimer may cause a compiler crash.
|
||||
@ -1226,11 +1275,22 @@ draw_polygon(GeomPolygon *geom, GeomContext *) {
|
||||
// Description:
|
||||
////////////////////////////////////////////////////////////////////
|
||||
void CLP(GraphicsStateGuardian)::
|
||||
draw_tri(GeomTri *geom, GeomContext *) {
|
||||
draw_tri(GeomTri *geom, GeomContext *gc) {
|
||||
#ifdef GSG_VERBOSE
|
||||
GLCAT.spam() << "draw_tri()" << endl;
|
||||
#endif
|
||||
|
||||
if (gc != (GeomContext *)NULL) {
|
||||
_draw_primitive_pcollector.start();
|
||||
CLP(GeomContext) *ggc = DCAST(CLP(GeomContext), gc);
|
||||
GLP(CallList)(ggc->_index);
|
||||
#ifdef DO_PSTATS
|
||||
_vertices_display_list_pcollector.add_level(ggc->_num_verts);
|
||||
#endif
|
||||
_draw_primitive_pcollector.stop();
|
||||
return;
|
||||
}
|
||||
|
||||
#ifdef DO_PSTATS
|
||||
// PStatTimer timer(_draw_primitive_pcollector);
|
||||
// Using PStatTimer may cause a compiler crash.
|
||||
@ -1302,11 +1362,22 @@ draw_tri(GeomTri *geom, GeomContext *) {
|
||||
// Description:
|
||||
////////////////////////////////////////////////////////////////////
|
||||
void CLP(GraphicsStateGuardian)::
|
||||
draw_quad(GeomQuad *geom, GeomContext *) {
|
||||
draw_quad(GeomQuad *geom, GeomContext *gc) {
|
||||
#ifdef GSG_VERBOSE
|
||||
GLCAT.spam() << "draw_quad()" << endl;
|
||||
#endif
|
||||
|
||||
if (gc != (GeomContext *)NULL) {
|
||||
_draw_primitive_pcollector.start();
|
||||
CLP(GeomContext) *ggc = DCAST(CLP(GeomContext), gc);
|
||||
GLP(CallList)(ggc->_index);
|
||||
#ifdef DO_PSTATS
|
||||
_vertices_display_list_pcollector.add_level(ggc->_num_verts);
|
||||
#endif
|
||||
_draw_primitive_pcollector.stop();
|
||||
return;
|
||||
}
|
||||
|
||||
#ifdef DO_PSTATS
|
||||
// PStatTimer timer(_draw_primitive_pcollector);
|
||||
// Using PStatTimer may cause a compiler crash.
|
||||
@ -1376,11 +1447,23 @@ draw_quad(GeomQuad *geom, GeomContext *) {
|
||||
// Description:
|
||||
////////////////////////////////////////////////////////////////////
|
||||
void CLP(GraphicsStateGuardian)::
|
||||
draw_tristrip(GeomTristrip *geom, GeomContext *) {
|
||||
draw_tristrip(GeomTristrip *geom, GeomContext *gc) {
|
||||
#ifdef GSG_VERBOSE
|
||||
GLCAT.spam() << "draw_tristrip()" << endl;
|
||||
#endif
|
||||
|
||||
if (gc != (GeomContext *)NULL) {
|
||||
_draw_primitive_pcollector.start();
|
||||
CLP(GeomContext) *ggc = DCAST(CLP(GeomContext), gc);
|
||||
GLP(CallList)(ggc->_index);
|
||||
#ifdef DO_PSTATS
|
||||
_vertices_display_list_pcollector.add_level(ggc->_num_verts);
|
||||
#endif
|
||||
_draw_primitive_pcollector.stop();
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
#ifdef DO_PSTATS
|
||||
// PStatTimer timer(_draw_primitive_pcollector);
|
||||
// Using PStatTimer may cause a compiler crash.
|
||||
@ -1472,11 +1555,22 @@ draw_tristrip(GeomTristrip *geom, GeomContext *) {
|
||||
// Description:
|
||||
////////////////////////////////////////////////////////////////////
|
||||
void CLP(GraphicsStateGuardian)::
|
||||
draw_trifan(GeomTrifan *geom, GeomContext *) {
|
||||
draw_trifan(GeomTrifan *geom, GeomContext *gc) {
|
||||
#ifdef GSG_VERBOSE
|
||||
GLCAT.spam() << "draw_trifan()" << endl;
|
||||
#endif
|
||||
|
||||
if (gc != (GeomContext *)NULL) {
|
||||
_draw_primitive_pcollector.start();
|
||||
CLP(GeomContext) *ggc = DCAST(CLP(GeomContext), gc);
|
||||
GLP(CallList)(ggc->_index);
|
||||
#ifdef DO_PSTATS
|
||||
_vertices_display_list_pcollector.add_level(ggc->_num_verts);
|
||||
#endif
|
||||
_draw_primitive_pcollector.stop();
|
||||
return;
|
||||
}
|
||||
|
||||
#ifdef DO_PSTATS
|
||||
// PStatTimer timer(_draw_primitive_pcollector);
|
||||
// Using PStatTimer may cause a compiler crash.
|
||||
@ -1569,11 +1663,22 @@ draw_trifan(GeomTrifan *geom, GeomContext *) {
|
||||
// Description:
|
||||
////////////////////////////////////////////////////////////////////
|
||||
void CLP(GraphicsStateGuardian)::
|
||||
draw_sphere(GeomSphere *geom, GeomContext *) {
|
||||
draw_sphere(GeomSphere *geom, GeomContext *gc) {
|
||||
#ifdef GSG_VERBOSE
|
||||
GLCAT.spam() << "draw_sphere()" << endl;
|
||||
#endif
|
||||
|
||||
if (gc != (GeomContext *)NULL) {
|
||||
_draw_primitive_pcollector.start();
|
||||
CLP(GeomContext) *ggc = DCAST(CLP(GeomContext), gc);
|
||||
GLP(CallList)(ggc->_index);
|
||||
#ifdef DO_PSTATS
|
||||
_vertices_display_list_pcollector.add_level(ggc->_num_verts);
|
||||
#endif
|
||||
_draw_primitive_pcollector.stop();
|
||||
return;
|
||||
}
|
||||
|
||||
#ifdef DO_PSTATS
|
||||
// PStatTimer timer(_draw_primitive_pcollector);
|
||||
// Using PStatTimer may cause a compiler crash.
|
||||
@ -1722,43 +1827,34 @@ release_texture(TextureContext *tc) {
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
// Function: CLP(GraphicsStateGuardian)::prepare_geom_node
|
||||
// Function: CLP(GraphicsStateGuardian)::prepare_geom
|
||||
// Access: Public, Virtual
|
||||
// Description: Prepares the indicated GeomNode for retained-mode
|
||||
// rendering. If this function returns non-NULL, the
|
||||
// value returned will be passed back to a future call
|
||||
// to draw_geom_node(), which is expected to draw the
|
||||
// contents of the node.
|
||||
// Description: Creates a new retained-mode representation of the
|
||||
// given geom, and returns a newly-allocated
|
||||
// GeomContext pointer to reference it. It is the
|
||||
// responsibility of the calling function to later
|
||||
// call release_geom() with this same pointer (which
|
||||
// will also delete the pointer).
|
||||
//
|
||||
// This function should not be called directly to
|
||||
// prepare a geom. Instead, call Geom::prepare().
|
||||
////////////////////////////////////////////////////////////////////
|
||||
GeomNodeContext *CLP(GraphicsStateGuardian)::
|
||||
prepare_geom_node(GeomNode *node) {
|
||||
#if 0 // temporarily disabled until we bring to new scene graph
|
||||
|
||||
// Make sure we have at least some static Geoms in the GeomNode;
|
||||
// otherwise there's no point in building a display list.
|
||||
int num_geoms = node->get_num_geoms();
|
||||
bool all_dynamic = true;
|
||||
int i;
|
||||
|
||||
for (i = 0; (i < num_geoms) && all_dynamic; i++) {
|
||||
dDrawable *geom = node->get_geom(i);
|
||||
all_dynamic = geom->is_dynamic();
|
||||
GeomContext *CLP(GraphicsStateGuardian)::
|
||||
prepare_geom(Geom *geom) {
|
||||
CLP(GeomContext) *ggc = new CLP(GeomContext)(geom);
|
||||
ggc->_index = GLP(GenLists)(1);
|
||||
if (GLCAT.is_debug()) {
|
||||
GLCAT.debug()
|
||||
<< "preparing " << *geom << ", index " << ggc->_index << "\n";
|
||||
}
|
||||
if (all_dynamic) {
|
||||
// Never mind.
|
||||
return (GeomNodeContext *)NULL;
|
||||
}
|
||||
|
||||
// Ok, we've got something; use it.
|
||||
CLP(GeomNodeContext) *ggnc = new CLP(GeomNodeContext)(node);
|
||||
ggnc->_index = GLP(GenLists)(1);
|
||||
if (ggnc->_index == 0) {
|
||||
if (ggc->_index == 0) {
|
||||
GLCAT.error()
|
||||
<< "Ran out of display list indices.\n";
|
||||
delete ggnc;
|
||||
return (GeomNodeContext *)NULL;
|
||||
delete ggc;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/*
|
||||
// We need to temporarily force normals and UV's on, so the display
|
||||
// list will have them built in.
|
||||
bool old_normals_enabled = _normals_enabled;
|
||||
@ -1767,12 +1863,13 @@ prepare_geom_node(GeomNode *node) {
|
||||
_normals_enabled = true;
|
||||
_texturing_enabled = true;
|
||||
_vertex_colors_enabled = true;
|
||||
*/
|
||||
|
||||
#ifdef DO_PSTATS
|
||||
// Count up the number of vertices we're about to render, by
|
||||
// checking the PStats vertex counters now, and at the end. This is
|
||||
// kind of hacky, but this is debug code.
|
||||
float num_verts_before =
|
||||
float num_verts_before =
|
||||
_vertices_tristrip_pcollector.get_level() +
|
||||
_vertices_trifan_pcollector.get_level() +
|
||||
_vertices_tri_pcollector.get_level() +
|
||||
@ -1780,109 +1877,51 @@ prepare_geom_node(GeomNode *node) {
|
||||
#endif
|
||||
|
||||
// Now define the display list.
|
||||
GLP(NewList)(ggnc->_index, GL_COMPILE);
|
||||
for (i = 0; i < num_geoms; i++) {
|
||||
dDrawable *geom = node->get_geom(i);
|
||||
if (geom->is_dynamic()) {
|
||||
// Wait, this is a dynamic Geom. We can't safely put it in the
|
||||
// display list, because it may change from one frame to the
|
||||
// next; instead, we'll keep it out.
|
||||
ggnc->_dynamic_geoms.push_back(geom);
|
||||
} else {
|
||||
// A static Geom becomes part of the display list.
|
||||
geom->draw(this);
|
||||
}
|
||||
}
|
||||
GLP(NewList)(ggc->_index, GL_COMPILE);
|
||||
geom->draw_immediate(this, NULL);
|
||||
GLP(EndList)();
|
||||
|
||||
#ifdef DO_PSTATS
|
||||
float num_verts_after =
|
||||
float num_verts_after =
|
||||
_vertices_tristrip_pcollector.get_level() +
|
||||
_vertices_trifan_pcollector.get_level() +
|
||||
_vertices_tri_pcollector.get_level() +
|
||||
_vertices_other_pcollector.get_level();
|
||||
float num_verts = num_verts_after - num_verts_before;
|
||||
ggnc->_num_verts = (int)(num_verts + 0.5);
|
||||
ggc->_num_verts = (int)(num_verts + 0.5);
|
||||
#endif
|
||||
|
||||
/*
|
||||
_normals_enabled = old_normals_enabled;
|
||||
_texturing_enabled = old_texturing_enabled;
|
||||
_vertex_colors_enabled = old_vertex_colors_enabled;
|
||||
*/
|
||||
|
||||
bool inserted = _prepared_objects->mark_prepared_geom_node(ggnc);
|
||||
|
||||
// If this assertion fails, the same GeomNode was prepared twice,
|
||||
// which shouldn't be possible, since the GeomNode itself should
|
||||
// detect this.
|
||||
nassertr(inserted, NULL);
|
||||
|
||||
return ggnc;
|
||||
#endif // temporarily disabled until we bring to new scene graph
|
||||
return NULL;
|
||||
report_my_gl_errors();
|
||||
return ggc;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
// Function: CLP(GraphicsStateGuardian)::draw_geom_node
|
||||
// Function: CLP(GraphicsStateGuardian)::release_geom
|
||||
// Access: Public, Virtual
|
||||
// Description: Draws a GeomNode previously indicated by a call to
|
||||
// prepare_geom_node().
|
||||
// Description: Frees the GL resources previously allocated for the
|
||||
// geom. This function should never be called
|
||||
// directly; instead, call Geom::release() (or simply
|
||||
// let the Geom destruct).
|
||||
////////////////////////////////////////////////////////////////////
|
||||
void CLP(GraphicsStateGuardian)::
|
||||
draw_geom_node(GeomNode *node, const RenderState *state,
|
||||
GeomNodeContext *gnc) {
|
||||
#if 0 // temporarily disabled until we bring to new scene graph
|
||||
if (gnc == (GeomNodeContext *)NULL) {
|
||||
// We don't have a saved context; just draw the GeomNode in
|
||||
// immediate mode.
|
||||
int num_geoms = node->get_num_geoms();
|
||||
for (int i = 0; i < num_geoms; i++) {
|
||||
node->get_geom(i)->draw(this);
|
||||
}
|
||||
|
||||
} else {
|
||||
// We do have a saved context; use it.
|
||||
add_to_geom_node_record(gnc);
|
||||
CLP(GeomNodeContext) *ggnc = DCAST(CLP(GeomNodeContext), gnc);
|
||||
GLP(CallList)(ggnc->_index);
|
||||
|
||||
#ifdef DO_PSTATS
|
||||
PStatTimer timer(_draw_primitive_pcollector);
|
||||
_vertices_display_list_pcollector.add_level(ggnc->_num_verts);
|
||||
#endif
|
||||
|
||||
// Also draw all the dynamic Geoms.
|
||||
int num_geoms = ggnc->_dynamic_geoms.size();
|
||||
for (int i = 0; i < num_geoms; i++) {
|
||||
ggnc->_dynamic_geoms[i]->draw(this);
|
||||
}
|
||||
release_geom(GeomContext *gc) {
|
||||
CLP(GeomContext) *ggc = DCAST(CLP(GeomContext), gc);
|
||||
if (GLCAT.is_debug()) {
|
||||
GLCAT.debug()
|
||||
<< "releasing index " << ggc->_index << "\n";
|
||||
}
|
||||
#endif // temporarily disabled until we bring to new scene graph
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
// Function: CLP(GraphicsStateGuardian)::release_geom_node
|
||||
// Access: Public, Virtual
|
||||
// Description: Frees the resources previously allocated via a call
|
||||
// to prepare_geom_node(), including deleting the
|
||||
// GeomNodeContext itself, if necessary.
|
||||
////////////////////////////////////////////////////////////////////
|
||||
void CLP(GraphicsStateGuardian)::
|
||||
release_geom_node(GeomNodeContext *gnc) {
|
||||
#if 0 // temporarily disabled until we bring to new scene graph
|
||||
if (gnc != (GeomNodeContext *)NULL) {
|
||||
CLP(GeomNodeContext) *ggnc = DCAST(CLP(GeomNodeContext), gnc);
|
||||
GLP(DeleteLists)(ggnc->_index, 1);
|
||||
GLP(DeleteLists)(ggc->_index, 1);
|
||||
report_my_gl_errors();
|
||||
|
||||
bool erased = _prepared_objects->unmark_prepared_geom_node(ggnc);
|
||||
|
||||
// If this assertion fails, a GeomNode was released that hadn't
|
||||
// been prepared (or a GeomNode was released twice).
|
||||
nassertv(erased);
|
||||
|
||||
ggnc->_node->clear_gsg(this);
|
||||
delete ggnc;
|
||||
}
|
||||
#endif // temporarily disabled until we bring to new scene graph
|
||||
ggc->_index = 0;
|
||||
delete ggc;
|
||||
}
|
||||
|
||||
#if 0
|
||||
|
@ -70,10 +70,8 @@ public:
|
||||
virtual void apply_texture(TextureContext *tc);
|
||||
virtual void release_texture(TextureContext *tc);
|
||||
|
||||
virtual GeomNodeContext *prepare_geom_node(GeomNode *node);
|
||||
virtual void draw_geom_node(GeomNode *node, const RenderState *state,
|
||||
GeomNodeContext *gnc);
|
||||
virtual void release_geom_node(GeomNodeContext *gnc);
|
||||
virtual GeomContext *prepare_geom(Geom *geom);
|
||||
virtual void release_geom(GeomContext *gc);
|
||||
|
||||
virtual void copy_texture(Texture *tex, const DisplayRegion *dr);
|
||||
virtual void copy_texture(Texture *tex, const DisplayRegion *dr,
|
||||
|
@ -20,7 +20,6 @@
|
||||
|
||||
#include "savedFrameBuffer.h"
|
||||
#include "texture.h"
|
||||
#include "textureContext.h"
|
||||
#include "pixelBuffer.h"
|
||||
|
||||
|
||||
|
@ -71,6 +71,6 @@ void CLP(init_classes)() {
|
||||
CLP(GraphicsStateGuardian)::init_type();
|
||||
CLP(SavedFrameBuffer)::init_type();
|
||||
CLP(TextureContext)::init_type();
|
||||
CLP(GeomNodeContext)::init_type();
|
||||
CLP(GeomContext)::init_type();
|
||||
}
|
||||
|
||||
|
@ -22,8 +22,8 @@
|
||||
// order to include this file.
|
||||
|
||||
#include "glmisc_src.cxx"
|
||||
#include "glGeomNodeContext_src.cxx"
|
||||
#include "glTextureContext_src.cxx"
|
||||
#include "glGeomContext_src.cxx"
|
||||
#include "glSavedFrameBuffer_src.cxx"
|
||||
#include "glGraphicsStateGuardian_src.cxx"
|
||||
|
||||
|
@ -40,8 +40,8 @@
|
||||
#include "glext.h"
|
||||
|
||||
#include "glmisc_src.h"
|
||||
#include "glGeomNodeContext_src.h"
|
||||
#include "glTextureContext_src.h"
|
||||
#include "glGeomContext_src.h"
|
||||
#include "glSavedFrameBuffer_src.h"
|
||||
#include "glGraphicsStateGuardian_src.h"
|
||||
|
||||
|
@ -11,19 +11,21 @@
|
||||
#define SOURCES \
|
||||
LOD.I LOD.h \
|
||||
boundedObject.I boundedObject.h \
|
||||
config_gobj.h drawable.h geom.I geom.N \
|
||||
geom.h geomLine.h geomLinestrip.h geomPoint.h geomPolygon.h \
|
||||
config_gobj.h drawable.h \
|
||||
geom.I geom.h \
|
||||
geomContext.I geomContext.h \
|
||||
geomLine.h geomLinestrip.h geomPoint.h geomPolygon.h \
|
||||
geomQuad.h geomSphere.h geomSprite.I geomSprite.h geomTri.h \
|
||||
geomTrifan.h geomTristrip.h imageBuffer.I imageBuffer.h \
|
||||
material.I material.h materialPool.I materialPool.h \
|
||||
matrixLens.I matrixLens.h \
|
||||
orthographicLens.I orthographicLens.h perspectiveLens.I \
|
||||
perspectiveLens.h pixelBuffer.I pixelBuffer.N \
|
||||
perspectiveLens.h pixelBuffer.I \
|
||||
pixelBuffer.h \
|
||||
preparedGraphicsObjects.I preparedGraphicsObjects.h \
|
||||
lens.h lens.I \
|
||||
savedContext.I savedContext.h \
|
||||
texture.I texture.N texture.h \
|
||||
texture.I texture.h \
|
||||
textureContext.I textureContext.h \
|
||||
texturePool.I texturePool.h
|
||||
|
||||
@ -31,6 +33,7 @@
|
||||
LOD.cxx \
|
||||
boundedObject.cxx \
|
||||
config_gobj.cxx drawable.cxx geom.cxx \
|
||||
geomContext.cxx \
|
||||
geomLine.cxx geomLinestrip.cxx geomPoint.cxx geomPolygon.cxx \
|
||||
geomQuad.cxx geomSphere.cxx geomSprite.cxx geomTri.cxx \
|
||||
geomTrifan.cxx geomTristrip.cxx imageBuffer.cxx material.cxx \
|
||||
@ -44,7 +47,9 @@
|
||||
LOD.I LOD.h \
|
||||
boundedObject.I boundedObject.h \
|
||||
config_gobj.h \
|
||||
drawable.h geom.I geom.h geomLine.h \
|
||||
drawable.h geom.I geom.h \
|
||||
textureContext.I textureContext.h \
|
||||
geomLine.h \
|
||||
geomLinestrip.h geomPoint.h geomPolygon.h geomQuad.h geomSphere.h \
|
||||
geomSprite.I geomSprite.h geomTri.h geomTrifan.h geomTristrip.h \
|
||||
geomprimitives.h imageBuffer.I imageBuffer.h material.I material.h \
|
||||
|
@ -1,12 +0,0 @@
|
||||
ignoremember GetNextVertex
|
||||
ignoremember GetNextNormal
|
||||
ignoremember GetNextTexCoord
|
||||
ignoremember GetNextColor
|
||||
ignoremember get_coords
|
||||
ignoremember get_normals
|
||||
ignoremember get_colors
|
||||
ignoremember get_texcoords
|
||||
ignoreinvolved VertexIterator
|
||||
ignoreinvolved NormalIterator
|
||||
ignoreinvolved TexCoordIterator
|
||||
ignoreinvolved ColorIterator
|
@ -28,6 +28,7 @@
|
||||
#include "ioPtaDatagramShort.h"
|
||||
#include "ioPtaDatagramInt.h"
|
||||
#include "ioPtaDatagramLinMath.h"
|
||||
#include "preparedGraphicsObjects.h"
|
||||
#include "indent.h"
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
@ -137,11 +138,8 @@ ostream &operator << (ostream &out, GeomAttrType t) {
|
||||
// Description:
|
||||
////////////////////////////////////////////////////////////////////
|
||||
Geom::
|
||||
Geom(void) : dDrawable() {
|
||||
/*
|
||||
_prepared_gsg = (GraphicsStateGuardianBase *)NULL;
|
||||
_prepared_context = (GeomContext *)NULL;
|
||||
*/
|
||||
Geom() {
|
||||
_all_dirty_flags = 0;
|
||||
init();
|
||||
}
|
||||
|
||||
@ -152,10 +150,7 @@ Geom(void) : dDrawable() {
|
||||
////////////////////////////////////////////////////////////////////
|
||||
Geom::
|
||||
Geom(const Geom& copy) : dDrawable() {
|
||||
/*
|
||||
_prepared_gsg = (GraphicsStateGuardianBase *)NULL;
|
||||
_prepared_context = (GeomContext *)NULL;
|
||||
*/
|
||||
_all_dirty_flags = 0;
|
||||
*this = copy;
|
||||
}
|
||||
|
||||
@ -166,7 +161,7 @@ Geom(const Geom& copy) : dDrawable() {
|
||||
////////////////////////////////////////////////////////////////////
|
||||
Geom::
|
||||
~Geom() {
|
||||
// unprepare();
|
||||
release_all();
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
@ -420,6 +415,23 @@ is_dynamic() const {
|
||||
return (_vindex != (ushort*)0L);
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
// Function: Geom::prepare
|
||||
// Access: Published
|
||||
// Description: Indicates that the geom should be enqueued to be
|
||||
// prepared in the indicated prepared_objects at the
|
||||
// beginning of the next frame. This will ensure the
|
||||
// geom is already loaded into the GSG if it is expected
|
||||
// to be rendered soon.
|
||||
//
|
||||
// Use this function instead of prepare_now() to preload
|
||||
// geoms from a user interface standpoint.
|
||||
////////////////////////////////////////////////////////////////////
|
||||
void Geom::
|
||||
prepare(PreparedGraphicsObjects *prepared_objects) {
|
||||
prepared_objects->enqueue_geom(this);
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
// Function: Geom::explode
|
||||
// Access: Public, Virtual
|
||||
@ -464,14 +476,17 @@ get_tris() const {
|
||||
////////////////////////////////////////////////////////////////////
|
||||
void Geom::
|
||||
draw(GraphicsStateGuardianBase *gsg) {
|
||||
PreparedGraphicsObjects *prepared_objects = gsg->get_prepared_objects();
|
||||
if (is_dirty()) {
|
||||
config();
|
||||
release(prepared_objects);
|
||||
}
|
||||
/*
|
||||
if (_prepared_gsg == gsg) {
|
||||
draw_immediate(gsg, _prepared_context);
|
||||
} else */ {
|
||||
draw_immediate(gsg, (GeomContext *)NULL);
|
||||
|
||||
if (retained_mode) {
|
||||
GeomContext *gc = prepare_now(gsg->get_prepared_objects(), gsg);
|
||||
draw_immediate(gsg, gc);
|
||||
} else {
|
||||
draw_immediate(gsg, NULL);
|
||||
}
|
||||
}
|
||||
|
||||
@ -516,9 +531,6 @@ config() {
|
||||
} else {
|
||||
_get_color = get_color_noop;
|
||||
}
|
||||
|
||||
// Mark the Geom as needing to be prepared again.
|
||||
// unprepare();
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
@ -552,81 +564,94 @@ output(ostream &out) const {
|
||||
*/
|
||||
}
|
||||
|
||||
/*
|
||||
////////////////////////////////////////////////////////////////////
|
||||
// Function: Geom::prepare
|
||||
// Function: Geom::prepare_now
|
||||
// Access: Public
|
||||
// Description: Creates a context for the Geom on the particular
|
||||
// Description: Creates a context for the geom on the particular
|
||||
// GSG, if it does not already exist. Returns the new
|
||||
// (or old) GeomContext.
|
||||
// (or old) GeomContext. This assumes that the
|
||||
// GraphicsStateGuardian is the currently active
|
||||
// rendering context and that it is ready to accept new
|
||||
// geoms. If this is not necessarily the case, you
|
||||
// should use prepare() instead.
|
||||
//
|
||||
// If the given GeomContext pointer is non-NULL, it will
|
||||
// be passed to the GSG, which may or may not choose to
|
||||
// extend the existing GeomContext, or create a totally
|
||||
// new one.
|
||||
// Normally, this is not called directly except by the
|
||||
// GraphicsStateGuardian; a geom does not need to be
|
||||
// explicitly prepared by the user before it may be
|
||||
// rendered.
|
||||
////////////////////////////////////////////////////////////////////
|
||||
GeomContext *Geom::
|
||||
prepare(GraphicsStateGuardianBase *gsg) {
|
||||
if (gsg != _prepared_gsg) {
|
||||
GeomContext *gc = gsg->prepare_geom(this);
|
||||
if (gc != (GeomContext *)NULL) {
|
||||
unprepare();
|
||||
_prepared_context = gc;
|
||||
_prepared_gsg = gsg;
|
||||
}
|
||||
return gc;
|
||||
prepare_now(PreparedGraphicsObjects *prepared_objects,
|
||||
GraphicsStateGuardianBase *gsg) {
|
||||
Contexts::const_iterator ci;
|
||||
ci = _contexts.find(prepared_objects);
|
||||
if (ci != _contexts.end()) {
|
||||
return (*ci).second;
|
||||
}
|
||||
|
||||
return _prepared_context;
|
||||
GeomContext *gc = prepared_objects->prepare_geom_now(this, gsg);
|
||||
if (gc != (GeomContext *)NULL) {
|
||||
_contexts[prepared_objects] = gc;
|
||||
|
||||
// Now that we have a new GeomContext with zero dirty flags, our
|
||||
// intersection of all dirty flags must be zero. This doesn't mean
|
||||
// that some other contexts aren't still dirty, but at least one
|
||||
// context isn't.
|
||||
_all_dirty_flags = 0;
|
||||
}
|
||||
return gc;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
// Function: Geom::unprepare
|
||||
// Function: Geom::release
|
||||
// Access: Public
|
||||
// Description: Frees the context allocated on all GSG's for which
|
||||
// the geom has been declared.
|
||||
// Description: Frees the geom context only on the indicated object,
|
||||
// if it exists there. Returns true if it was released,
|
||||
// false if it had not been prepared.
|
||||
////////////////////////////////////////////////////////////////////
|
||||
void Geom::
|
||||
unprepare() {
|
||||
if (_prepared_gsg != (GraphicsStateGuardianBase *)NULL) {
|
||||
_prepared_gsg->release_geom(_prepared_context);
|
||||
_prepared_gsg = (GraphicsStateGuardianBase *)NULL;
|
||||
_prepared_context = (GeomContext *)NULL;
|
||||
bool Geom::
|
||||
release(PreparedGraphicsObjects *prepared_objects) {
|
||||
Contexts::iterator ci;
|
||||
ci = _contexts.find(prepared_objects);
|
||||
if (ci != _contexts.end()) {
|
||||
GeomContext *gc = (*ci).second;
|
||||
prepared_objects->release_geom(gc);
|
||||
return true;
|
||||
}
|
||||
|
||||
// Maybe it wasn't prepared yet, but it's about to be.
|
||||
return prepared_objects->dequeue_geom(this);
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
// Function: Geom::unprepare
|
||||
// Function: Geom::release_all
|
||||
// Access: Public
|
||||
// Description: Frees the geom context only on the indicated GSG,
|
||||
// if it exists there.
|
||||
// Description: Frees the context allocated on all objects for which
|
||||
// the geom has been declared. Returns the number of
|
||||
// contexts which have been freed.
|
||||
////////////////////////////////////////////////////////////////////
|
||||
void Geom::
|
||||
unprepare(GraphicsStateGuardianBase *gsg) {
|
||||
if (_prepared_gsg == gsg) {
|
||||
_prepared_gsg->release_geom(_prepared_context);
|
||||
_prepared_gsg = (GraphicsStateGuardianBase *)NULL;
|
||||
_prepared_context = (GeomContext *)NULL;
|
||||
}
|
||||
}
|
||||
int Geom::
|
||||
release_all() {
|
||||
// We have to traverse a copy of the _contexts list, because the
|
||||
// PreparedGraphicsObjects object will call clear_prepared() in response
|
||||
// to each release_geom(), and we don't want to be modifying the
|
||||
// _contexts list while we're traversing it.
|
||||
Contexts temp = _contexts;
|
||||
int num_freed = (int)_contexts.size();
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
// Function: Geom::clear_gsg
|
||||
// Access: Public
|
||||
// Description: Removes the indicated GSG from the Geom's known
|
||||
// GSG's, without actually releasing the geom on that
|
||||
// GSG. This is intended to be called only from
|
||||
// GSG::release_geom(); it should never be called by
|
||||
// user code.
|
||||
////////////////////////////////////////////////////////////////////
|
||||
void Geom::
|
||||
clear_gsg(GraphicsStateGuardianBase *gsg) {
|
||||
if (_prepared_gsg == gsg) {
|
||||
_prepared_gsg = (GraphicsStateGuardianBase *)NULL;
|
||||
_prepared_context = (GeomContext *)NULL;
|
||||
Contexts::const_iterator ci;
|
||||
for (ci = temp.begin(); ci != temp.end(); ++ci) {
|
||||
PreparedGraphicsObjects *prepared_objects = (*ci).first;
|
||||
GeomContext *gc = (*ci).second;
|
||||
prepared_objects->release_geom(gc);
|
||||
}
|
||||
|
||||
// Now that we've called release_geom() on every known context,
|
||||
// the _contexts list should have completely emptied itself.
|
||||
nassertr(_contexts.empty(), num_freed);
|
||||
|
||||
return num_freed;
|
||||
}
|
||||
*/
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
// Function: Geom::init
|
||||
@ -691,6 +716,28 @@ recompute_bound() {
|
||||
return bound;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
// Function: Geom::clear_prepared
|
||||
// Access: Private
|
||||
// Description: Removes the indicated PreparedGraphicsObjects table
|
||||
// from the Geom's table, without actually releasing
|
||||
// the geom. This is intended to be called only from
|
||||
// PreparedGraphicsObjects::release_geom(); it should
|
||||
// never be called by user code.
|
||||
////////////////////////////////////////////////////////////////////
|
||||
void Geom::
|
||||
clear_prepared(PreparedGraphicsObjects *prepared_objects) {
|
||||
Contexts::iterator ci;
|
||||
ci = _contexts.find(prepared_objects);
|
||||
if (ci != _contexts.end()) {
|
||||
_contexts.erase(ci);
|
||||
} else {
|
||||
// If this assertion fails, clear_prepared() was given a
|
||||
// prepared_objects which the geom didn't know about.
|
||||
nassertv(false);
|
||||
}
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
// Function: Geom::write_datagram
|
||||
// Access: Public
|
||||
|
@ -189,6 +189,8 @@ PUBLISHED:
|
||||
INLINE const PTA_ushort &get_colors_index() const;
|
||||
INLINE const PTA_ushort &get_texcoords_index() const;
|
||||
|
||||
void prepare(PreparedGraphicsObjects *prepared_objects);
|
||||
|
||||
public:
|
||||
INLINE void set_num_prims(int num);
|
||||
INLINE int get_num_prims() const;
|
||||
@ -224,12 +226,10 @@ public:
|
||||
INLINE ColorIterator make_color_iterator() const;
|
||||
INLINE const Colorf &get_next_color(ColorIterator &citerator) const;
|
||||
|
||||
/*
|
||||
GeomContext *prepare(GraphicsStateGuardianBase *gsg);
|
||||
void unprepare();
|
||||
void unprepare(GraphicsStateGuardianBase *gsg);
|
||||
void clear_gsg(GraphicsStateGuardianBase *gsg);
|
||||
*/
|
||||
GeomContext *prepare_now(PreparedGraphicsObjects *prepared_objects,
|
||||
GraphicsStateGuardianBase *gsg);
|
||||
bool release(PreparedGraphicsObjects *prepared_objects);
|
||||
int release_all();
|
||||
|
||||
protected:
|
||||
void init();
|
||||
@ -257,16 +257,21 @@ protected:
|
||||
GetNextTexCoord *_get_texcoord;
|
||||
GetNextColor *_get_color;
|
||||
|
||||
// Unlike a Texture, a Geom only stores the pointer to one GSG that
|
||||
// it has been prepared into. If it is prepared into another GSG,
|
||||
// it automatically unprepares itself from the first one. This is
|
||||
// intended to reduce memory overhead that would otherwise be
|
||||
// required to support a little-used feature (having two
|
||||
// simultaneous GSG's).
|
||||
/*
|
||||
GraphicsStateGuardianBase *_prepared_gsg;
|
||||
GeomContext *_prepared_context;
|
||||
*/
|
||||
private:
|
||||
void clear_prepared(PreparedGraphicsObjects *prepared_objects);
|
||||
|
||||
// A Geom keeps a list (actually, a map) of all the
|
||||
// PreparedGraphicsObjects tables that it has been prepared into.
|
||||
// Each PGO conversely keeps a list (a set) of all the Geoms that
|
||||
// have been prepared there. When either destructs, it removes
|
||||
// itself from the other's list.
|
||||
typedef pmap<PreparedGraphicsObjects *, GeomContext *> Contexts;
|
||||
Contexts _contexts;
|
||||
|
||||
// This value represents the intersection of all the dirty flags of
|
||||
// the various GeomContexts that might be associated with this
|
||||
// geom.
|
||||
int _all_dirty_flags;
|
||||
|
||||
public:
|
||||
//static void register_with_read_factory(void);
|
||||
@ -294,6 +299,8 @@ public:
|
||||
private:
|
||||
static TypeHandle _type_handle;
|
||||
|
||||
friend class GeomContext;
|
||||
friend class PreparedGraphicsObjects;
|
||||
};
|
||||
|
||||
INLINE ostream &operator <<(ostream &out, const Geom &geom) {
|
||||
|
91
panda/src/gobj/geomContext.I
Normal file
91
panda/src/gobj/geomContext.I
Normal file
@ -0,0 +1,91 @@
|
||||
// Filename: geomContext.I
|
||||
// Created by: drose (19Mar04)
|
||||
//
|
||||
////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// PANDA 3D SOFTWARE
|
||||
// Copyright (c) 2001 - 2004, Disney Enterprises, Inc. All rights reserved
|
||||
//
|
||||
// All use of this software is subject to the terms of the Panda 3d
|
||||
// Software license. You should have received a copy of this license
|
||||
// along with this source code; you will also find a current copy of
|
||||
// the license at http://etc.cmu.edu/panda3d/docs/license/ .
|
||||
//
|
||||
// To contact the maintainers of this program write to
|
||||
// panda3d-general@lists.sourceforge.net .
|
||||
//
|
||||
////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
// Function: GeomContext::Constructor
|
||||
// Access: Public
|
||||
// Description:
|
||||
////////////////////////////////////////////////////////////////////
|
||||
INLINE GeomContext::
|
||||
GeomContext(Geom *geom) :
|
||||
_geom(geom)
|
||||
{
|
||||
_dirty_flags = 0;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
// Function: GeomContext::mark_dirty
|
||||
// Access: Public
|
||||
// Description: Marks the context "dirty", i.e. its properties are
|
||||
// different from the last time the GSG has seen them.
|
||||
// Presumably, the GSG will respond by updating the
|
||||
// properties and clearing the dirty bits the next time
|
||||
// it renders the geom.
|
||||
//
|
||||
// The value is the union of all the bits that are to be
|
||||
// set dirty; bits that are not set in this parameter
|
||||
// are left unchanged. See Geom::DirtyFlags for a
|
||||
// list of available bits.
|
||||
//
|
||||
// Usually this function is not called directly, but
|
||||
// rather is called by Geom::mark_dirty() as a result
|
||||
// of changing properties directly on the geom.
|
||||
////////////////////////////////////////////////////////////////////
|
||||
INLINE void GeomContext::
|
||||
mark_dirty(int flags_to_set) {
|
||||
_dirty_flags |= flags_to_set;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
// Function: GeomContext::clear_dirty_flags
|
||||
// Access: Public
|
||||
// Description: Removes the indicated flags from the "dirty" bits.
|
||||
// See mark_dirty().
|
||||
//
|
||||
// The value is the union of all the bits that are to be
|
||||
// cleared; if a bit is set in the parameter, it will be
|
||||
// removed from the dirty set. Bits that are not set in
|
||||
// this parameter are left unchanged.
|
||||
//
|
||||
// This function is intended to be called by the GSG
|
||||
// after it has updated the geom parameters.
|
||||
////////////////////////////////////////////////////////////////////
|
||||
INLINE void GeomContext::
|
||||
clear_dirty_flags(int flags_to_clear) {
|
||||
_dirty_flags &= ~flags_to_clear;
|
||||
_geom->_all_dirty_flags &= ~flags_to_clear;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
// Function: GeomContext::get_dirty_flags
|
||||
// Access: Public
|
||||
// Description: Returns the current state of the dirty flags. If
|
||||
// this is non-zero, it represents the union of all
|
||||
// properties that have been changed since the last call
|
||||
// to clear_dirty_flags().
|
||||
//
|
||||
// This function is intended to be called by the GSG to
|
||||
// determine what properties need to be updated. See
|
||||
// Geom::DirtyFlags for a list of possible bits.
|
||||
////////////////////////////////////////////////////////////////////
|
||||
INLINE int GeomContext::
|
||||
get_dirty_flags() const {
|
||||
return _dirty_flags;
|
||||
}
|
||||
|
@ -1,5 +1,5 @@
|
||||
// Filename: geomContext.cxx
|
||||
// Created by: drose (11Jun01)
|
||||
// Created by: drose (19Mar04)
|
||||
//
|
||||
////////////////////////////////////////////////////////////////////
|
||||
//
|
@ -1,5 +1,5 @@
|
||||
// Filename: geomContext.h
|
||||
// Created by: drose (11Jun01)
|
||||
// Created by: drose (19Mar04)
|
||||
//
|
||||
////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
@ -22,25 +22,23 @@
|
||||
#include "pandabase.h"
|
||||
|
||||
#include "savedContext.h"
|
||||
|
||||
class Geom;
|
||||
#include "geom.h"
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
// Class : GeomContext
|
||||
// Description : This is a special class object, similar to a
|
||||
// TextureContext, that holds all the information
|
||||
// returned by a particular GSG to cache the rendering
|
||||
// information associated with one or more Geoms. This
|
||||
// is similar to, but different from, a GeomNode
|
||||
// context, which is associated with the containing
|
||||
// GeomNode class; a GSG might prefer to associate data
|
||||
// with either the Geom or the GeomNode or both.
|
||||
// Description : This is a special class object that holds all the
|
||||
// information returned by a particular GSG to indicate
|
||||
// the geom's internal context identifier.
|
||||
//
|
||||
// This allows the GSG to precompute some information
|
||||
// necessary for drawing the Geoms as quickly as
|
||||
// possible and reuse that information across multiple
|
||||
// frames. Typically, only static Geoms
|
||||
// (e.g. nonindexed) will be assigned GeomContexts.
|
||||
// Geoms typically have an immediate-mode and a
|
||||
// retained-mode operation. When using geoms in
|
||||
// retained-mode (in response to Geom::prepare()),
|
||||
// the GSG will create some internal handle for the
|
||||
// geom and store it here. The geom stores all of
|
||||
// these handles internally.
|
||||
//
|
||||
// In the case of OpenGL, for example, a GeomContext
|
||||
// corresponds to a display list identifier.
|
||||
////////////////////////////////////////////////////////////////////
|
||||
class EXPCL_PANDA GeomContext : public SavedContext {
|
||||
public:
|
||||
@ -51,6 +49,14 @@ public:
|
||||
// reference count.
|
||||
Geom *_geom;
|
||||
|
||||
INLINE void mark_dirty(int flags_to_set);
|
||||
INLINE void clear_dirty_flags(int flags_to_clear = ~0);
|
||||
INLINE int get_dirty_flags() const;
|
||||
|
||||
private:
|
||||
int _dirty_flags;
|
||||
|
||||
|
||||
public:
|
||||
static TypeHandle get_class_type() {
|
||||
return _type_handle;
|
@ -1,8 +1,9 @@
|
||||
|
||||
#include "config_gobj.cxx"
|
||||
#include "LOD.cxx"
|
||||
#include "drawable.cxx"
|
||||
#include "geomContext.cxx"
|
||||
#include "imageBuffer.cxx"
|
||||
#include "LOD.cxx"
|
||||
#include "material.cxx"
|
||||
#include "materialPool.cxx"
|
||||
#include "orthographicLens.cxx"
|
||||
|
@ -1,3 +0,0 @@
|
||||
ignoreinvolved Type
|
||||
ignoreinvolved Format
|
||||
|
@ -40,10 +40,10 @@ PreparedGraphicsObjects() {
|
||||
////////////////////////////////////////////////////////////////////
|
||||
PreparedGraphicsObjects::
|
||||
~PreparedGraphicsObjects() {
|
||||
// There may be texture objects that are still prepared when we
|
||||
// destruct. If this is so, then all of the GSG's that own them
|
||||
// have already destructed, so we can assume their resources were
|
||||
// internally cleaned up. Quietly erase these remaining textures.
|
||||
// There may be objects that are still prepared when we destruct.
|
||||
// If this is so, then all of the GSG's that own them have already
|
||||
// destructed, so we can assume their resources were internally
|
||||
// cleaned up. Quietly erase these remaining objects.
|
||||
|
||||
MutexHolder holder(_lock);
|
||||
|
||||
@ -59,6 +59,18 @@ PreparedGraphicsObjects::
|
||||
_prepared_textures.clear();
|
||||
_released_textures.clear();
|
||||
_enqueued_textures.clear();
|
||||
|
||||
Geoms::iterator gci;
|
||||
for (gci = _prepared_geoms.begin();
|
||||
gci != _prepared_geoms.end();
|
||||
++gci) {
|
||||
GeomContext *gc = (*gci);
|
||||
gc->_geom->clear_prepared(this);
|
||||
}
|
||||
|
||||
_prepared_geoms.clear();
|
||||
_released_geoms.clear();
|
||||
_enqueued_geoms.clear();
|
||||
}
|
||||
|
||||
|
||||
@ -206,6 +218,147 @@ prepare_texture_now(Texture *tex, GraphicsStateGuardianBase *gsg) {
|
||||
return tc;
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
// Function: PreparedGraphicsObjects::enqueue_geom
|
||||
// Access: Public
|
||||
// Description: Indicates that a geom would like to be put on the
|
||||
// list to be prepared when the GSG is next ready to
|
||||
// do this (presumably at the next frame).
|
||||
////////////////////////////////////////////////////////////////////
|
||||
void PreparedGraphicsObjects::
|
||||
enqueue_geom(Geom *geom) {
|
||||
MutexHolder holder(_lock);
|
||||
|
||||
_enqueued_geoms.insert(geom);
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
// Function: PreparedGraphicsObjects::dequeue_geom
|
||||
// Access: Public
|
||||
// Description: Removes a geom from the queued list of geoms to
|
||||
// be prepared. Normally it is not necessary to call
|
||||
// this, unless you change your mind about preparing it
|
||||
// at the last minute, since the geom will
|
||||
// automatically be dequeued and prepared at the next
|
||||
// frame.
|
||||
//
|
||||
// The return value is true if the geom is
|
||||
// successfully dequeued, false if it had not been
|
||||
// queued.
|
||||
////////////////////////////////////////////////////////////////////
|
||||
bool PreparedGraphicsObjects::
|
||||
dequeue_geom(Geom *geom) {
|
||||
MutexHolder holder(_lock);
|
||||
|
||||
EnqueuedGeoms::iterator qi = _enqueued_geoms.find(geom);
|
||||
if (qi != _enqueued_geoms.end()) {
|
||||
_enqueued_geoms.erase(qi);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
// Function: PreparedGraphicsObjects::release_geom
|
||||
// Access: Public
|
||||
// Description: Indicates that a geom context, created by a
|
||||
// previous call to prepare_geom(), is no longer
|
||||
// needed. The driver resources will not be freed until
|
||||
// some GSG calls update(), indicating it is at a
|
||||
// stage where it is ready to release geoms--this
|
||||
// prevents conflicts from threading or multiple GSG's
|
||||
// sharing geoms (we have no way of knowing which
|
||||
// graphics context is currently active, or what state
|
||||
// it's in, at the time release_geom is called).
|
||||
////////////////////////////////////////////////////////////////////
|
||||
void PreparedGraphicsObjects::
|
||||
release_geom(GeomContext *gc) {
|
||||
MutexHolder holder(_lock);
|
||||
|
||||
gc->_geom->clear_prepared(this);
|
||||
|
||||
// We have to set the Geom pointer to NULL at this point, since
|
||||
// the Geom itself might destruct at any time after it has been
|
||||
// released.
|
||||
gc->_geom = (Geom *)NULL;
|
||||
|
||||
bool removed = (_prepared_geoms.erase(gc) != 0);
|
||||
nassertv(removed);
|
||||
|
||||
_released_geoms.insert(gc);
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
// Function: PreparedGraphicsObjects::release_all_geoms
|
||||
// Access: Public
|
||||
// Description: Releases all geoms at once. This will force them
|
||||
// to be reloaded into geom memory for all GSG's that
|
||||
// share this object. Returns the number of geoms
|
||||
// released.
|
||||
////////////////////////////////////////////////////////////////////
|
||||
int PreparedGraphicsObjects::
|
||||
release_all_geoms() {
|
||||
MutexHolder holder(_lock);
|
||||
|
||||
int num_geoms = (int)_prepared_geoms.size();
|
||||
|
||||
Geoms::iterator gci;
|
||||
for (gci = _prepared_geoms.begin();
|
||||
gci != _prepared_geoms.end();
|
||||
++gci) {
|
||||
GeomContext *gc = (*gci);
|
||||
gc->_geom->clear_prepared(this);
|
||||
gc->_geom = (Geom *)NULL;
|
||||
|
||||
_released_geoms.insert(gc);
|
||||
}
|
||||
|
||||
_prepared_geoms.clear();
|
||||
|
||||
return num_geoms;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
// Function: PreparedGraphicsObjects::prepare_geom_now
|
||||
// Access: Public
|
||||
// Description: Immediately creates a new GeomContext for the
|
||||
// indicated geom and returns it. This assumes that
|
||||
// the GraphicsStateGuardian is the currently active
|
||||
// rendering context and that it is ready to accept new
|
||||
// geoms. If this is not necessarily the case, you
|
||||
// should use enqueue_geom() instead.
|
||||
//
|
||||
// Normally, this function is not called directly. Call
|
||||
// Geom::prepare_now() instead.
|
||||
//
|
||||
// The GeomContext contains all of the pertinent
|
||||
// information needed by the GSG to keep track of this
|
||||
// one particular geom, and will exist as long as the
|
||||
// geom is ready to be rendered.
|
||||
//
|
||||
// When either the Geom or the
|
||||
// PreparedGraphicsObjects object destructs, the
|
||||
// GeomContext will be deleted.
|
||||
////////////////////////////////////////////////////////////////////
|
||||
GeomContext *PreparedGraphicsObjects::
|
||||
prepare_geom_now(Geom *geom, GraphicsStateGuardianBase *gsg) {
|
||||
MutexHolder holder(_lock);
|
||||
|
||||
// Ask the GSG to create a brand new GeomContext. There might
|
||||
// be several GSG's sharing the same set of geoms; if so, it
|
||||
// doesn't matter which of them creates the context (since they're
|
||||
// all shared anyway).
|
||||
GeomContext *gc = gsg->prepare_geom(geom);
|
||||
|
||||
if (gc != (GeomContext *)NULL) {
|
||||
bool prepared = _prepared_geoms.insert(gc).second;
|
||||
nassertr(prepared, gc);
|
||||
}
|
||||
|
||||
return gc;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
// Function: PreparedGraphicsObjects::update
|
||||
// Access: Public
|
||||
@ -233,14 +386,36 @@ update(GraphicsStateGuardianBase *gsg) {
|
||||
|
||||
_released_textures.clear();
|
||||
|
||||
// Next, release all the geoms awaiting release.
|
||||
Geoms::iterator gci;
|
||||
for (gci = _released_geoms.begin();
|
||||
gci != _released_geoms.end();
|
||||
++gci) {
|
||||
GeomContext *gc = (*gci);
|
||||
gsg->release_geom(gc);
|
||||
}
|
||||
|
||||
_released_geoms.clear();
|
||||
|
||||
// Now prepare all the textures awaiting preparation.
|
||||
EnqueuedTextures::iterator qi;
|
||||
for (qi = _enqueued_textures.begin();
|
||||
qi != _enqueued_textures.end();
|
||||
++qi) {
|
||||
Texture *tex = (*qi);
|
||||
EnqueuedTextures::iterator qti;
|
||||
for (qti = _enqueued_textures.begin();
|
||||
qti != _enqueued_textures.end();
|
||||
++qti) {
|
||||
Texture *tex = (*qti);
|
||||
tex->prepare_now(this, gsg);
|
||||
}
|
||||
|
||||
_enqueued_textures.clear();
|
||||
|
||||
// And finally prepare all the geoms awaiting preparation.
|
||||
EnqueuedGeoms::iterator qgi;
|
||||
for (qgi = _enqueued_geoms.begin();
|
||||
qgi != _enqueued_geoms.end();
|
||||
++qgi) {
|
||||
Geom *geom = (*qgi);
|
||||
geom->prepare_now(this, gsg);
|
||||
}
|
||||
|
||||
_enqueued_geoms.clear();
|
||||
}
|
||||
|
@ -28,7 +28,6 @@
|
||||
|
||||
class TextureContext;
|
||||
class GeomContext;
|
||||
class GeomNodeContext;
|
||||
class GraphicsStateGuardianBase;
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
@ -61,15 +60,27 @@ public:
|
||||
int release_all_textures();
|
||||
|
||||
TextureContext *prepare_texture_now(Texture *tex, GraphicsStateGuardianBase *gsg);
|
||||
|
||||
void enqueue_geom(Geom *geom);
|
||||
bool dequeue_geom(Geom *geom);
|
||||
void release_geom(GeomContext *gc);
|
||||
int release_all_geoms();
|
||||
|
||||
GeomContext *prepare_geom_now(Geom *geom, GraphicsStateGuardianBase *gsg);
|
||||
|
||||
void update(GraphicsStateGuardianBase *gsg);
|
||||
|
||||
private:
|
||||
typedef pset<TextureContext *> Textures;
|
||||
typedef pset< PT(Texture) > EnqueuedTextures;
|
||||
typedef pset<GeomContext *> Geoms;
|
||||
typedef pset< PT(Geom) > EnqueuedGeoms;
|
||||
|
||||
Mutex _lock;
|
||||
Textures _prepared_textures, _released_textures;
|
||||
EnqueuedTextures _enqueued_textures;
|
||||
Geoms _prepared_geoms, _released_geoms;
|
||||
EnqueuedGeoms _enqueued_geoms;
|
||||
|
||||
static PStatCollector _total_texusage_pcollector;
|
||||
|
||||
|
@ -485,7 +485,7 @@ is_mipmap(FilterType type) {
|
||||
// GraphicsStateGuardian is the currently active
|
||||
// rendering context and that it is ready to accept new
|
||||
// textures. If this is not necessarily the case, you
|
||||
// should use prepare_later() instead.
|
||||
// should use prepare() instead.
|
||||
//
|
||||
// Normally, this is not called directly except by the
|
||||
// GraphicsStateGuardian; a texture does not need to be
|
||||
|
@ -32,10 +32,10 @@
|
||||
//
|
||||
// Textures typically have an immediate-mode and a
|
||||
// retained-mode operation. When using textures in
|
||||
// retained-mode (in response to
|
||||
// Texture::prepare_texture()), the GSG will create some
|
||||
// internal handle for the texture and store it here.
|
||||
// The texture stores all of these handles internally.
|
||||
// retained-mode (in response to Texture::prepare()),
|
||||
// the GSG will create some internal handle for the
|
||||
// texture and store it here. The texture stores all of
|
||||
// these handles internally.
|
||||
////////////////////////////////////////////////////////////////////
|
||||
class EXPCL_PANDA TextureContext : public SavedContext {
|
||||
public:
|
||||
|
@ -30,7 +30,6 @@ class RenderBuffer;
|
||||
class GraphicsWindow;
|
||||
|
||||
class GeomContext;
|
||||
class GeomNodeContext;
|
||||
class GeomNode;
|
||||
class Geom;
|
||||
class GeomPoint;
|
||||
@ -118,11 +117,6 @@ public:
|
||||
virtual void apply_texture(TextureContext *tc)=0;
|
||||
virtual void release_texture(TextureContext *tc)=0;
|
||||
|
||||
virtual GeomNodeContext *prepare_geom_node(GeomNode *node)=0;
|
||||
virtual void draw_geom_node(GeomNode *node, const RenderState *state,
|
||||
GeomNodeContext *gnc)=0;
|
||||
virtual void release_geom_node(GeomNodeContext *gnc)=0;
|
||||
|
||||
virtual GeomContext *prepare_geom(Geom *geom)=0;
|
||||
virtual void release_geom(GeomContext *gc)=0;
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user