Panda3D
Public Member Functions | Static Public Member Functions | Public Attributes | Protected Member Functions

glxGraphicsStateGuardian Class Reference

A tiny specialization on GLGraphicsStateGuardian to add some glx-specific information. More...

#include "glxGraphicsStateGuardian.h"

List of all members.

Public Member Functions

 glxGraphicsStateGuardian (GraphicsEngine *engine, GraphicsPipe *pipe, glxGraphicsStateGuardian *share_with)
void choose_pixel_format (const FrameBufferProperties &properties, Display *_display, int _screen, bool need_pbuffer, bool need_pixmap)
 Selects a visual or fbconfig for all the windows and buffers that use this gsg.
virtual TypeHandle force_init_type ()
const FrameBufferPropertiesget_fb_properties () const
 Gets the FrameBufferProperties for all windows and buffers that use this GSG.
void get_properties (FrameBufferProperties &properties, XVisualInfo *visual)
 Gets the FrameBufferProperties to match the indicated visual.
void get_properties_advanced (FrameBufferProperties &properties, bool &context_has_pbuffer, bool &pixmap_supported, bool &slow, GLXFBConfig config)
 Gets the FrameBufferProperties to match the indicated GLXFBConfig.
virtual TypeHandle get_type () const
bool glx_is_at_least_version (int major_version, int minor_version) const
 Returns true if the runtime GLX version number is at least the indicated value, false otherwise.
virtual void reset ()
 Resets all internal state as if the gsg were newly created.

Static Public Member Functions

static TypeHandle get_class_type ()
static void init_type ()

Public Attributes

GLXContext _context
bool _context_has_pbuffer
bool _context_has_pixmap
Display * _display
GLXFBConfig _fbconfig
FrameBufferProperties _fbprops
PFNGLXCHOOSEFBCONFIGPROC _glXChooseFBConfig
PFNGLXCREATEGLXPBUFFERSGIXPROC _glXCreateGLXPbufferSGIX
PFNGLXCREATENEWCONTEXTPROC _glXCreateNewContext
PFNGLXCREATEPBUFFERPROC _glXCreatePbuffer
PFNGLXCREATEPIXMAPPROC _glXCreatePixmap
PFNGLXDESTROYPBUFFERPROC _glXDestroyPbuffer
PFNGLXGETFBCONFIGATTRIBPROC _glXGetFBConfigAttrib
PFNGLXGETVISUALFROMFBCONFIGPROC _glXGetVisualFromFBConfig
PFNGLXSWAPINTERVALSGIPROC _glXSwapIntervalSGI
int _screen
GLXContext _share_context
bool _slow
bool _supports_fbconfig
bool _supports_pbuffer
bool _supports_swap_control
bool _uses_sgix_pbuffer
XVisualInfo * _visual
XVisualInfo * _visuals

Protected Member Functions

virtual void * do_get_extension_func (const char *prefix, const char *name)
 Returns the pointer to the GL extension function with the indicated name.
virtual void get_extra_extensions ()
 This may be redefined by a derived class (e.g.
virtual void gl_flush () const
 Calls glFlush().
virtual GLenum gl_get_error () const
 Returns the result of glGetError().
virtual void query_gl_version ()
 Queries the runtime version of OpenGL in use.

Detailed Description

A tiny specialization on GLGraphicsStateGuardian to add some glx-specific information.

Definition at line 82 of file glxGraphicsStateGuardian.h.


Member Function Documentation

void glxGraphicsStateGuardian::choose_pixel_format ( const FrameBufferProperties properties,
Display *  display,
int  screen,
bool  need_pbuffer,
bool  need_pixmap 
)

Selects a visual or fbconfig for all the windows and buffers that use this gsg.

Also creates the GL context and obtains the visual.

Definition at line 233 of file glxGraphicsStateGuardian.cxx.

References FrameBufferProperties::clear(), get_properties_advanced(), and FrameBufferProperties::get_quality().

Referenced by glxGraphicsPixmap::open_buffer(), glxGraphicsBuffer::open_buffer(), and glxGraphicsWindow::open_window().

void * glxGraphicsStateGuardian::do_get_extension_func ( const char *  prefix,
const char *  name 
) [protected, virtual]

Returns the pointer to the GL extension function with the indicated name.

It is the responsibility of the caller to ensure that the required extension is defined in the OpenGL runtime prior to calling this; it is an error to call this for a function that is not defined.

Definition at line 632 of file glxGraphicsStateGuardian.cxx.

References glx_is_at_least_version().

void glxGraphicsStateGuardian::get_extra_extensions ( ) [protected, virtual]

This may be redefined by a derived class (e.g.

glx or wgl) to get whatever further extensions strings may be appropriate to that interface, in addition to the GL extension strings return by glGetString().

Definition at line 617 of file glxGraphicsStateGuardian.cxx.

const FrameBufferProperties & glxGraphicsStateGuardian::get_fb_properties ( ) const [inline]

Gets the FrameBufferProperties for all windows and buffers that use this GSG.

Definition at line 22 of file glxGraphicsStateGuardian.I.

Referenced by glxGraphicsPixmap::open_buffer(), glxGraphicsBuffer::open_buffer(), and glxGraphicsWindow::open_window().

void glxGraphicsStateGuardian::get_properties ( FrameBufferProperties properties,
XVisualInfo *  visual 
)

Gets the FrameBufferProperties to match the indicated visual.

Definition at line 91 of file glxGraphicsStateGuardian.cxx.

References FrameBufferProperties::clear().

void glxGraphicsStateGuardian::get_properties_advanced ( FrameBufferProperties properties,
bool &  context_has_pbuffer,
bool &  pixmap_supported,
bool &  slow,
GLXFBConfig  config 
)

Gets the FrameBufferProperties to match the indicated GLXFBConfig.

Definition at line 151 of file glxGraphicsStateGuardian.cxx.

References FrameBufferProperties::clear().

Referenced by choose_pixel_format().

void glxGraphicsStateGuardian::gl_flush ( ) const [protected, virtual]

Calls glFlush().

Definition at line 564 of file glxGraphicsStateGuardian.cxx.

GLenum glxGraphicsStateGuardian::gl_get_error ( ) const [protected, virtual]

Returns the result of glGetError().

Definition at line 576 of file glxGraphicsStateGuardian.cxx.

bool glxGraphicsStateGuardian::glx_is_at_least_version ( int  major_version,
int  minor_version 
) const

Returns true if the runtime GLX version number is at least the indicated value, false otherwise.

Definition at line 545 of file glxGraphicsStateGuardian.cxx.

Referenced by do_get_extension_func(), and reset().

void glxGraphicsStateGuardian::query_gl_version ( ) [protected, virtual]

Queries the runtime version of OpenGL in use.

Definition at line 588 of file glxGraphicsStateGuardian.cxx.

void glxGraphicsStateGuardian::reset ( ) [virtual]

Resets all internal state as if the gsg were newly created.

Definition at line 401 of file glxGraphicsStateGuardian.cxx.

References glx_is_at_least_version().


The documentation for this class was generated from the following files:
 All Classes Functions Variables Enumerations