Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

vuDrawTools Class Reference

This class provides basic drawing function using the GUI (wxWindows). This is an alternative to OpenGL rendering allowing more direct frame buffer access. More...

#include <vuDrawTools.h>

List of all members.

Static Public Member Functions

void setDC (void *pDC)
 attach a draw context */
void quitDC ()
 finish drawing actions for current device context
void setColour (byte r, byte g, byte b)
 set the current drawing colour
void setBGColour (byte r, byte g, byte b)
 set the current background colour (for clearBG)
void setPixel (int x, int y)
 set a Pixel with the current drawing colour
void blit (const byte *buf, int sx, int sy, int px, int py)
 blit the framebuffer to the screen
void blit2 (const byte *buf, int sx, int sy, int px, int py)
void partblit (const byte *buf, int sx, int sy, int length)
void finishpartblit ()
void setImgWidthHeight (int sx, int sy)
unsigned char * getData ()
void clearBG ()
 clear the entire drawing area
void clearBGWithoutRect (int ox, int oy, int sx, int sy)
 some try to optimize the clearBG


Detailed Description

This class provides basic drawing function using the GUI (wxWindows). This is an alternative to OpenGL rendering allowing more direct frame buffer access.

This class has been created to provide access to the bit blit operations of the GUI. This is necessairy because OpenGLs glWritePixels is incredibly slow on PCs.

Todo:
The problem now is to make the blit used here effective. Therefore we may maintain one (or two) memory buffers which can be accessed directly from the render function. Then we have to find an effective way of blitting this via wxWindows (or in another way?).

As an alternative to the glSwapBuffers() command it is desirable to maintain a frame buffer for an active window. This could avoid complete rerendering on simple frame redrawing. The Blit function has to be wrapped to display off-screen renderings. This will also be useful to maintaind a second frame buffer for fast screen refresh.

Definition at line 46 of file vuDrawTools.h.


Member Function Documentation

void vuDrawTools::blit const byte buf,
int  sx,
int  sy,
int  px,
int  py
[static]
 

blit the framebuffer to the screen

As mentioned above. This function needs to be improved. Perhaps we do not allow an external framebuffer but instead give a handle to an internal one.

Definition at line 83 of file vuDrawTools.cpp.

References byte, cDC, and img.

void vuDrawTools::blit2 const byte buf,
int  sx,
int  sy,
int  px,
int  py
[static]
 

Definition at line 97 of file vuDrawTools.cpp.

References byte, cDC, and img.

void vuDrawTools::clearBG  )  [static]
 

clear the entire drawing area

Definition at line 66 of file vuDrawTools.cpp.

References cDC.

void vuDrawTools::clearBGWithoutRect int  ox,
int  oy,
int  sx,
int  sy
[static]
 

some try to optimize the clearBG

...but doesn't work and will be obsolete with an improved version of vuDrawTools

Definition at line 173 of file vuDrawTools.cpp.

References cDC.

void vuDrawTools::finishpartblit  )  [static]
 

Definition at line 115 of file vuDrawTools.cpp.

unsigned char * vuDrawTools::getData  )  [static]
 

Definition at line 140 of file vuDrawTools.cpp.

References img.

void vuDrawTools::partblit const byte buf,
int  sx,
int  sy,
int  length
[static]
 

Definition at line 110 of file vuDrawTools.cpp.

References byte.

void vuDrawTools::quitDC  )  [static]
 

finish drawing actions for current device context

Definition at line 163 of file vuDrawTools.cpp.

References cDC.

void vuDrawTools::setBGColour byte  r,
byte  g,
byte  b
[static]
 

set the current background colour (for clearBG)

Parameters:
r,g,b red, green, blue values from 0 to 255

Definition at line 52 of file vuDrawTools.cpp.

References byte, and cDC.

void vuDrawTools::setColour byte  r,
byte  g,
byte  b
[static]
 

set the current drawing colour

Parameters:
r,g,b red, green, blue values from 0 to 255

Definition at line 37 of file vuDrawTools.cpp.

References byte, and cDC.

void vuDrawTools::setDC void *  pDC  )  [static]
 

attach a draw context */

Parameters:
pDC is a pointer to a wxDC but because there is no association with wxWindows here, we have to cast it to void*

Definition at line 149 of file vuDrawTools.cpp.

References cDC.

void vuDrawTools::setImgWidthHeight int  sx,
int  sy
[static]
 

Definition at line 120 of file vuDrawTools.cpp.

References img.

void vuDrawTools::setPixel int  x,
int  y
[static]
 

set a Pixel with the current drawing colour

Definition at line 23 of file vuDrawTools.cpp.

References cDC.


The documentation for this class was generated from the following files:
Generated on Wed Dec 15 21:21:14 2004 for vuVolume by  doxygen 1.3.9.1