Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members   Related Pages  

OpenGLDisplayDevice Class Reference

Subclass of OpenGLRenderer, this object has routines used by all the different display devices that are OpenGL-specific. Will render drawing commands into a single X window. More...

#include <OpenGLDisplayDevice.h>

Inheritance diagram for OpenGLDisplayDevice:

OpenGLRenderer DisplayDevice List of all members.

Public Methods

 OpenGLDisplayDevice ()
int init (int argc, char **argv, VMDApp *app, int *size, int *loc=NULL)
 do actual window construction here. Return true if the window was successfully created; false if not. More...

virtual ~OpenGLDisplayDevice (void)
virtual int x (void)
virtual int y (void)
 absolute position of cursor from lower-left corner. More...

virtual int shift_state (void)
virtual int spaceball (int *, int *, int *, int *, int *, int *, int *)
 return the shift state (ORed enums). More...

virtual void set_cursor (int)
virtual void queue_events (void)
virtual int read_event (long &, long &)
virtual int prepare3D (int do_clear=TRUE)
 ready to draw 3D. More...

virtual void update (int do_update=TRUE)
 finish up after drawing. More...

virtual void reshape (void)
 refresh device after change. More...

virtual unsigned char * readpixels_rgb3u (int &x, int &y)
 virtual routine for capturing the screen to a packed RGB array. More...

virtual unsigned char * readpixels_rgba4u (int &x, int &y)
 virtual routine for capturing the screen to a packed RGBA array. More...

virtual int drawpixels_rgba4u (unsigned char *rgba, int &x, int &y)
 virtual routine for drawing the screen from a packed RGBA array. More...

virtual void set_window_title (char *)

Public Attributes

glxdata glxsrv

Protected Methods

Window open_window (char *, int *, int *, int, char **)
virtual void do_resize_window (int, int)
virtual void do_reposition_window (int, int)

Protected Attributes

int have_window

Detailed Description

Subclass of OpenGLRenderer, this object has routines used by all the different display devices that are OpenGL-specific. Will render drawing commands into a single X window.

Definition at line 147 of file OpenGLDisplayDevice.h.


Constructor & Destructor Documentation

OpenGLDisplayDevice::OpenGLDisplayDevice  
 

Definition at line 698 of file OpenGLDisplayDevice.C.

References DisplayDevice::cacheModes, DisplayDevice::cacheNames, glxdata::dpy, glxdata::dpyScreen, glCacheNameStr, glRenderNameStr, glStereoNameStr, glxsrv, have_window, glxdata::havefocus, NULL, OPENGL_CACHE_MODES, OPENGL_RENDER_MODES, OPENGL_STEREO_MODES, DisplayDevice::renderModes, DisplayDevice::renderNames, glxdata::sball, DisplayDevice::screenX, DisplayDevice::screenY, DisplayDevice::stereoModes, DisplayDevice::stereoNames, and glxdata::xinp.

OpenGLDisplayDevice::~OpenGLDisplayDevice void    [virtual]
 

Definition at line 821 of file OpenGLDisplayDevice.C.

References glxdata::cx, glxdata::dpy, OpenGLRenderer::free_opengl_ctx, glxsrv, NULL, glxdata::sball, spaceball_close, glxdata::windowID, glxdata::xinp, and xinput_close.


Member Function Documentation

void OpenGLDisplayDevice::do_reposition_window int   ,
int   
[protected, virtual]
 

Reimplemented from DisplayDevice.

Definition at line 1097 of file OpenGLDisplayDevice.C.

References glxdata::dpy, glxsrv, and glxdata::windowID.

void OpenGLDisplayDevice::do_resize_window int   ,
int   
[protected, virtual]
 

Do device-specific resizing or positioning of window

Reimplemented from DisplayDevice.

Definition at line 1080 of file OpenGLDisplayDevice.C.

References glxdata::dpy, glxsrv, NULL, setfullscreen, and glxdata::windowID.

int OpenGLDisplayDevice::drawpixels_rgba4u unsigned char *    rgba,
int &    x,
int &    y
[virtual]
 

virtual routine for drawing the screen from a packed RGBA array.

Reimplemented from DisplayDevice.

Definition at line 1454 of file OpenGLDisplayDevice.C.

References glPopMatrix, and update.

int OpenGLDisplayDevice::init int    argc,
char **    argv,
VMDApp   app,
int *    size,
int *    loc = NULL
[virtual]
 

do actual window construction here. Return true if the window was successfully created; false if not.

Reimplemented from DisplayDevice.

Definition at line 727 of file OpenGLDisplayDevice.C.

References OpenGLRenderer::aa_on, DisplayDevice::aaAvailable, DisplayDevice::ao_enabled, OpenGLRenderer::clear, OpenGLRenderer::cueing_on, DisplayDevice::cueingAvailable, OpenGLRenderer::culling_off, DisplayDevice::cullingAvailable, DISP_LIGHTS, DisplayDevice::dof_enabled, OpenGLRenderer::ext, DisplayDevice::eyeDist, DisplayDevice::eyePos, DisplayDevice::eyeSep, DisplayDevice::get_ao_ambient, DisplayDevice::get_ao_direct, DisplayDevice::get_cue_density, DisplayDevice::get_cue_end, DisplayDevice::get_cue_start, DisplayDevice::get_dof_fnumber, DisplayDevice::get_dof_focal_dist, glxsrv, OpenGLExtensions::hasmultisample, have_window, DisplayDevice::lineStyle, DisplayDevice::lineWidth, DisplayDevice::name, OpenGLRenderer::normal, NULL, OpenGLRenderer::ogl_lightcolor, OpenGLRenderer::ogl_lightpos, OpenGLRenderer::ogl_lightstate, open_window, reshape, OptiXRenderer::RT_BACKGROUND_TEXTURE_SOLID, OptiXRenderer::RT_FOG_NONE, OptiXRenderer::RT_PERSPECTIVE, OpenGLRenderer::set_line_style, OpenGLRenderer::set_line_width, OpenGLRenderer::set_sphere_mode, OpenGLRenderer::set_sphere_res, DisplayDevice::shadows_enabled, size, DisplayDevice::sphereMode, DisplayDevice::sphereRes, update, DisplayDevice::vmdapp, DisplayDevice::vSize, glxdata::windowID, DisplayDevice::xSize, DisplayDevice::ySize, and DisplayDevice::zDist.

int OpenGLDisplayDevice::open_window char *   ,
int *   ,
int *   ,
int   ,
char **   
[protected]
 

Definition at line 857 of file OpenGLDisplayDevice.C.

References glxdata::cursor, cursorBG, cursorFG, glxdata::cx, glxdata::dpy, glxdata::dpyScreen, OpenGLRenderer::ext, glxsrv, OpenGLExtensions::hasmultisample, OpenGLExtensions::hasstereo, have_window, NULL, OpenGLExtensions::nummultisamples, glxdata::rootWindowID, glxdata::sball, glxdata::sballevent, DisplayDevice::screenX, DisplayDevice::screenY, OpenGLRenderer::setup_initial_opengl_state, size, glxdata::sizeHints, spaceball_enable, spaceball_init_event, OpenGLExtensions::stereodrawforced, vmd_get_visual, OpenGLExtensions::vmdQueryExtension, glxdata::xinp, and xinput_enable.

Referenced by init.

int OpenGLDisplayDevice::prepare3D int    do_clear = TRUE [virtual]
 

ready to draw 3D.

Reimplemented from OpenGLRenderer.

Definition at line 1071 of file OpenGLDisplayDevice.C.

References glxdata::cx, glxdata::dpy, glxsrv, OpenGLRenderer::prepare3D, and glxdata::windowID.

void OpenGLDisplayDevice::queue_events void    [virtual]
 

queue the standard events (need only be called once ... but this is not done automatically by the window because it may not be necessary or even wanted)

Reimplemented from DisplayDevice.

Definition at line 1206 of file OpenGLDisplayDevice.C.

References glxdata::dpy, glxsrv, and glxdata::windowID.

int OpenGLDisplayDevice::read_event long &   ,
long &   
[virtual]
 

read the next event ... returns an event type (one of the above ones), and a value. Returns success, and sets arguments. NOTE: THIS SHOULD NOT BLOCK ... IT SHOUULD RETURN FALSE IF NO EVENT TO READ.

Reimplemented from DisplayDevice.

Definition at line 1217 of file OpenGLDisplayDevice.C.

References DisplayDevice::_needRedraw, glxdata::dpy, glxsrv, glxdata::havefocus, NULL, reshape, glxdata::sball, glxdata::sballevent, spaceball_clear_event, spaceball_decode_event, DisplayDevice::WIN_KBD, DisplayDevice::WIN_KBD_DELETE, DisplayDevice::WIN_KBD_DOWN, DisplayDevice::WIN_KBD_END, DisplayDevice::WIN_KBD_ESCAPE, DisplayDevice::WIN_KBD_F1, DisplayDevice::WIN_KBD_F10, DisplayDevice::WIN_KBD_F11, DisplayDevice::WIN_KBD_F12, DisplayDevice::WIN_KBD_F2, DisplayDevice::WIN_KBD_F3, DisplayDevice::WIN_KBD_F4, DisplayDevice::WIN_KBD_F5, DisplayDevice::WIN_KBD_F6, DisplayDevice::WIN_KBD_F7, DisplayDevice::WIN_KBD_F8, DisplayDevice::WIN_KBD_F9, DisplayDevice::WIN_KBD_HOME, DisplayDevice::WIN_KBD_INSERT, DisplayDevice::WIN_KBD_LEFT, DisplayDevice::WIN_KBD_PAGE_UP, DisplayDevice::WIN_KBD_RIGHT, DisplayDevice::WIN_KBD_UP, DisplayDevice::WIN_LEFT, DisplayDevice::WIN_MIDDLE, DisplayDevice::WIN_NOEVENT, DisplayDevice::WIN_RIGHT, DisplayDevice::WIN_WHEELDOWN, DisplayDevice::WIN_WHEELUP, glxdata::xinp, and xinput_decode_event.

unsigned char * OpenGLDisplayDevice::readpixels_rgb3u int &    x,
int &    y
[virtual]
 

virtual routine for capturing the screen to a packed RGB array.

Reimplemented from DisplayDevice.

Definition at line 1417 of file OpenGLDisplayDevice.C.

References NULL, DisplayDevice::xSize, and DisplayDevice::ySize.

unsigned char * OpenGLDisplayDevice::readpixels_rgba4u int &    x,
int &    y
[virtual]
 

virtual routine for capturing the screen to a packed RGBA array.

Reimplemented from DisplayDevice.

Definition at line 1435 of file OpenGLDisplayDevice.C.

References NULL, DisplayDevice::xSize, and DisplayDevice::ySize.

Referenced by update.

void OpenGLDisplayDevice::reshape void    [virtual]
 

refresh device after change.

Reimplemented from DisplayDevice.

Definition at line 1362 of file OpenGLDisplayDevice.C.

References glxdata::dpy, OpenGLRenderer::enable_stencil_stereo, glxsrv, DisplayDevice::inStereo, OPENGL_STEREO_ABOVEBELOW, OPENGL_STEREO_SIDE, OPENGL_STEREO_STENCIL_CHECKERBOARD, OPENGL_STEREO_STENCIL_COLUMNS, OPENGL_STEREO_STENCIL_ROWS, glxdata::rootWindowID, DisplayDevice::screenY, DisplayDevice::set_screen_pos, glxdata::windowID, DisplayDevice::xOrig, DisplayDevice::xSize, DisplayDevice::yOrig, and DisplayDevice::ySize.

Referenced by init, read_event, and vmdWindowProc.

void OpenGLDisplayDevice::set_cursor int    [virtual]
 

set the Nth cursor shape as the current one. If no arg given, the default shape (n=0) is used.

Reimplemented from DisplayDevice.

Definition at line 1183 of file OpenGLDisplayDevice.C.

References glxdata::cursor, glxdata::dpy, glxsrv, n, DisplayDevice::NORMAL_CURSOR, DisplayDevice::PICK_CURSOR, DisplayDevice::SCALE_CURSOR, DisplayDevice::TRANS_CURSOR, DisplayDevice::WAIT_CURSOR, and glxdata::windowID.

Referenced by vmdWindowProc.

void OpenGLDisplayDevice::set_window_title char *    [virtual]
 

Reimplemented from OpenGLRenderer.

Definition at line 1580 of file OpenGLDisplayDevice.C.

References glxdata::dpy, glxsrv, and glxdata::windowID.

int OpenGLDisplayDevice::shift_state void    [virtual]
 

Reimplemented from DisplayDevice.

Definition at line 1137 of file OpenGLDisplayDevice.C.

References DisplayDevice::ALT, DisplayDevice::CONTROL, glxdata::dpy, glxsrv, DisplayDevice::SHIFT, and glxdata::windowID.

int OpenGLDisplayDevice::spaceball int *    rx,
int *    ry,
int *    rz,
int *    tx,
int *    ty,
int *    tz,
int *    buttons
[virtual]
 

return the shift state (ORed enums).

get the current state of the Spaceball if one is available returns rx ry rz, tx ty tz, buttons

Reimplemented from DisplayDevice.

Definition at line 1162 of file OpenGLDisplayDevice.C.

References spaceballevent::buttons, spaceballevent::event, glxsrv, NULL, spaceballevent::rx, spaceballevent::ry, spaceballevent::rz, glxdata::sball, glxdata::sballevent, spaceballevent::tx, spaceballevent::ty, spaceballevent::tz, and glxdata::xinp.

void OpenGLDisplayDevice::update int    do_update = TRUE [virtual]
 

finish up after drawing.

Reimplemented from DisplayDevice.

Definition at line 1546 of file OpenGLDisplayDevice.C.

References VideoStream::check_event, glxdata::dpy, glxsrv, NULL, readpixels_rgba4u, VideoStream::srv_connected, VMDApp::uivs, VideoStream::video_frame_pending, DisplayDevice::vmdapp, and glxdata::windowID.

Referenced by drawpixels_rgba4u, and init.

int OpenGLDisplayDevice::x void    [virtual]
 

Reimplemented from DisplayDevice.

Definition at line 1108 of file OpenGLDisplayDevice.C.

References glxdata::dpy, glxsrv, and glxdata::windowID.

int OpenGLDisplayDevice::y void    [virtual]
 

absolute position of cursor from lower-left corner.

Reimplemented from DisplayDevice.

Definition at line 1122 of file OpenGLDisplayDevice.C.

References glxdata::dpy, glxsrv, DisplayDevice::screenY, and glxdata::windowID.


Member Data Documentation

glxdata OpenGLDisplayDevice::glxsrv
 

Definition at line 154 of file OpenGLDisplayDevice.h.

Referenced by do_reposition_window, do_resize_window, init, open_window, OpenGLDisplayDevice, prepare3D, queue_events, read_event, reshape, set_cursor, set_window_title, shift_state, spaceball, update, x, y, and ~OpenGLDisplayDevice.

int OpenGLDisplayDevice::have_window [protected]
 

Definition at line 159 of file OpenGLDisplayDevice.h.

Referenced by init, open_window, and OpenGLDisplayDevice.


The documentation for this class was generated from the following files:
Generated on Fri Mar 29 02:47:52 2024 for VMD (current) by doxygen1.2.14 written by Dimitri van Heesch, © 1997-2002