Cafu Engine
SingleOpenGLWindowImplT Class Reference
Inheritance diagram for SingleOpenGLWindowImplT:

Public Member Functions

const char * Open (const std::string &Title_, unsigned int Width_, unsigned int Height_, char BPP_, bool FullScreen_)
 This functions opens a new OpenGL window. More...
 
bool HandleWindowMessages ()
 Retrieves the messages of the window message queue, and deals with them. More...
 
void PostQuitMessage ()
 Indicates that HandleWindowMessages() should return true anytime soon. More...
 
unsigned int GetSystemFontDisplayList (int FontHeight, const char *FontName)
 Returns the first of 256 OpenGL display list handles of an ASCII font character set. More...
 
void SwapBuffers ()
 Swaps the front- and back-buffers. More...
 
uint32_t * GetFrameBuffer (unsigned int &Width_, unsigned int &Height_)
 Returns a pointer to a copy of the current (back-)frame-buffer, and the width and height of the buffer. More...
 
void Close ()
 Well, this closes and destroys the window. More...
 
int GetNextKeyboardEvent (CaKeyboardEventT &KeyboardEvent)
 This function retrieves the next keyboard event, and stores it in 'KeyboardEvent'. More...
 
int GetNextMouseEvent (CaMouseEventT &MouseEvent)
 This function retrieves the next mouse event, and stores it in 'MouseEvent'. More...
 
const std::string & GetTitle ()
 
unsigned int GetWidth ()
 
unsigned int GetHeight ()
 
char GetBPP ()
 
bool GetFullScreen ()
 
bool GetIsMinimized ()
 Ist das Fenster in der Taskbar (minimiert)? More...
 
bool * GetKeyboardState ()
 < The function 'GetNextKeyboardEvent()' stores all keyboard events in this array. More...
 
char GetMouseButtonState ()
 
void SetIsMinimized (bool IsMin_)
 Called from the windows main proc. More...
 
void Resize (unsigned int Width_, unsigned int Height_)
 Passt den OpenGL-ViewPort an eine neue Fensterhöhe/-breite an. More...
 
- Public Member Functions inherited from SingleOpenGLWindowT
virtual ~SingleOpenGLWindowT ()
 Virtual destructor, so that deleting this class through derived-class pointers works right. More...
 

Member Function Documentation

void SingleOpenGLWindowImplT::Close ( )
virtual

Well, this closes and destroys the window.

Implements SingleOpenGLWindowT.

uint32_t * SingleOpenGLWindowImplT::GetFrameBuffer ( unsigned int &  Width_,
unsigned int &  Height_ 
)
virtual

Returns a pointer to a copy of the current (back-)frame-buffer, and the width and height of the buffer.

The returned pointer memory is statically allocated and the caller must not free it.

Implements SingleOpenGLWindowT.

bool SingleOpenGLWindowImplT::GetIsMinimized ( )
inlinevirtual

Ist das Fenster in der Taskbar (minimiert)?

Implements SingleOpenGLWindowT.

bool* SingleOpenGLWindowImplT::GetKeyboardState ( )
inlinevirtual

< The function 'GetNextKeyboardEvent()' stores all keyboard events in this array.

It can therefore be used to obtain the current state of the keyboard. Note that the state is current only after 'GetNextKeyboardEvent()' has been called until 0 was returned (i.e. the event queue is empty). The only purpuse of this array is to relieve the application from the book-keeping. The function 'GetNextMouseEvent()' stores all mouse button events in this 'char'. It can therefore be used to obtain the current state of the mouse buttons. Mouse button 'i' is pressed iff bit 'i' is set, and released otherwise. Note that the state is current only after 'GetNextMouseEvent()' has been called until 0 was returned (i.e. the event queue is empty). The only purpuse of this 'char' is to relieve the application from the book-keeping.

Implements SingleOpenGLWindowT.

int SingleOpenGLWindowImplT::GetNextKeyboardEvent ( CaKeyboardEventT KeyboardEvent)
virtual

This function retrieves the next keyboard event, and stores it in 'KeyboardEvent'.

Return values: -1 - An error occured, no events read. 'KeyboardEvent' is not touched. 0 - The event queue is empty, no events read. 'KeyboardEvent' is not touched. 1 - One event successfully read and stored in 'KeyboardEvent'. 2 - Same as 1, but events were lost due to buffer overflow.

Implements SingleOpenGLWindowT.

int SingleOpenGLWindowImplT::GetNextMouseEvent ( CaMouseEventT MouseEvent)
virtual

This function retrieves the next mouse event, and stores it in 'MouseEvent'.

Return values: -1 - An error occured, no events read. 'MouseEvent' is not touched. 0 - The event queue is empty, no events read. 'MouseEvent' is not touched. 1 - One event successfully read and stored in 'MouseEvent'. 2 - Same as 1, but events were lost due to buffer overflow.

Implements SingleOpenGLWindowT.

unsigned int SingleOpenGLWindowImplT::GetSystemFontDisplayList ( int  FontHeight,
const char *  FontName 
)
virtual

Returns the first of 256 OpenGL display list handles of an ASCII font character set.

Implements SingleOpenGLWindowT.

bool SingleOpenGLWindowImplT::HandleWindowMessages ( )
virtual

Retrieves the messages of the window message queue, and deals with them.

Returns 'true' on receipt of a program quit message, 'false' otherwise.

Implements SingleOpenGLWindowT.

const char * SingleOpenGLWindowImplT::Open ( const std::string &  Title_,
unsigned int  Width_,
unsigned int  Height_,
char  BPP_,
bool  FullScreen_ 
)
virtual

This functions opens a new OpenGL window.

Only one window can be open at one time. Returns 'NULL' on success, or a string with the reason for the failure. The global variables are initialized on success, and undefined otherwise. Notes: a) An 8 BPP stencil buffer is always requested. b) The far clip plane is always located at infinity, in order to facilitate stencil shadows (and arbitrary large levels :-).

Implements SingleOpenGLWindowT.

void SingleOpenGLWindowImplT::PostQuitMessage ( )
virtual

Indicates that HandleWindowMessages() should return true anytime soon.

Implements SingleOpenGLWindowT.

void SingleOpenGLWindowImplT::Resize ( unsigned int  Width_,
unsigned int  Height_ 
)

Passt den OpenGL-ViewPort an eine neue Fensterhöhe/-breite an.

void SingleOpenGLWindowImplT::SetIsMinimized ( bool  IsMin_)
inline

Called from the windows main proc.

void SingleOpenGLWindowImplT::SwapBuffers ( )
virtual

Swaps the front- and back-buffers.

Implements SingleOpenGLWindowT.


The documentation for this class was generated from the following file: