#include <DrawModelGLSW.h>
This class is part of the OpenGLTools namespace which is actually a subnamespace of the main namespace Tools.
After the final color values are calculated by the application's raycaster of the class RenderMachineSW this results´have to be drawn onto the canvas. Furthermore, this drawing process should be implemented with the help of OpenGL texture management for most efficient processing.
As every other class of the subpackage OpenGLTools this class has the base class OpenGLCode of the CSOpenGL library to correctly implement the OpenGL code Which will be handled by the OpenGLPanel which will show the specific drawing results on the screen.
Thus, te main task of this class is the mapping of the final color values which are stored as a two dimensional array into OgenGL texture objects which will be actually drawn onto the canvas.
RenderMachineSW - the actual raycaster of the application.
Public Member Functions | |
DrawModelGLSW (void) | |
This is the standard constructor. | |
DrawModelGLSW (short n_CanvasWidth, short n_CanvasHeight, short n_TextureWidth, short n_TextureHeight) | |
Constructor initialization with the valid canvas and texture sizes. | |
DrawModelGLSW (short n_CanvasWidth, short n_CanvasHeight, Color n_CanvasBackColor) | |
Constructor initialization with the valid canvas size and canvas background color. | |
DrawModelGLSW (short n_CanvasWidth, short n_CanvasHeight, short n_TextureWidth, short n_TextureHeight, unsigned char n_FrameBuffer __gc[], Color n_CanvasBackColor) | |
Constructor initialization with all included member variables. | |
~DrawModelGLSW (void) | |
This is the standard deconstructor. | |
virtual void | Init (void) |
This function overwrites the base init funtion of the class OpenGLCode. | |
virtual void | Draw (void) |
This function overwrites the base draw funtion of the class OpenGLCode. | |
__property void | set_CanvasWidth (short n_CanvasWidth) |
Sets a new witdh for the canvas. | |
__property void | set_CanvasHeight (short n_CanvasHeight) |
Sets a new height for the canvas. | |
__property void | set_TextureWidth (short n_TextureWidth) |
Sets a new width for the used texture object. | |
__property void | set_TextureHeight (short n_TextureHeight) |
Sets a new height for the used texture object. | |
__property void | set_CanvasBackColor (Color n_CanvasBackColor) |
Sets a new canvas background color. | |
__property short | get_CanvasWidth (void) |
Returns the witdh of the current canvas. | |
__property short | get_CanvasHeight (void) |
Returns the height of the current canvas. | |
__property short | get_TextureWidth (void) |
Returns the witdh of the current used texture object. | |
__property short | get_TextureHeight (void) |
Returns the height of the current used texture object. | |
void | setFrameBuffer (unsigned char n_FrameBuffer __gc[]) |
Sets new final color values as an two dimensional 8-bit array. | |
unsigned char | getFrameBuffer (void) __gc[] |
Returns the current stored color values. | |
Static Public Member Functions | |
static Bitmap * | GetBitmap (unsigned char n_FrameBuffer __gc[], int n_CanvasWidth, int n_CanvasHeight, int n_Resolution) |
Returns an instance of the standard Bitmap class. | |
Private Types | |
enum | ColorIndices |
Constant index values for the three color components red, green and blue. | |
Private Attributes | |
short | m_CanvasWidth |
Saves the current width of the canvas. | |
short | m_CanvasHeight |
Saves the current height of the canvas. | |
short | m_TextureWidth |
Saves the width of the essential texture object. | |
short | m_TextureHeight |
Saves the height of the essential texture object. | |
unsigned char m_FrameBuffer | __gc [] |
Saves the final color values. | |
float m_CanvasBackColor | __gc [] |
Saves the current canvas background color. | |
GLuint | m_ResultTex |
Saves the index of the used OpenGL texture object. |
|
This is the standard constructor. All member variables of this new instance will be set to zero/null. |
|
Constructor initialization with the valid canvas and texture sizes. All member variables will be set to zero besides the canvas dimension size member variables and the texture size member variables.
|
|
Constructor initialization with the valid canvas size and canvas background color. All member variables will be set to zero besides the canvas dimension size member variables and the canvas background member variable.
|
|
Constructor initialization with all included member variables. All member variables will be set to the cooresponding parameter. Thus, parameter for all included member variables have to be assigned.
|
|
This is the standard deconstructor. All member variables will be deleted. |
|
This function overwrites the base draw funtion of the class OpenGLCode. It contains the actual drawing code in OpenGL and also performs the code. |
|
Returns the height of the current canvas.
|
|
Returns the witdh of the current canvas.
|
|
Returns the height of the current used texture object.
|
|
Returns the witdh of the current used texture object.
|
|
Returns an instance of the standard Bitmap class. This function will be needed to store the calculated final color values into a graphic file like JEPG, BMP, etc.
|
|
Returns the current stored color values.
|
|
This function overwrites the base init funtion of the class OpenGLCode. It contains the actual initialization code in OpenGL and also performs the code. |
|
Sets a new canvas background color.
|
|
Sets a new height for the canvas.
|
|
Sets a new witdh for the canvas.
|
|
Sets a new height for the used texture object.
|
|
Sets a new width for the used texture object.
|
|
Sets new final color values as an two dimensional 8-bit array. Note that the dimensions of the color values array need not to be equal to the dimension of the current texture object (which actually is equal to the canvas dimension) because sampling is implemented.
|