Back to index

nux  3.0.0
Public Member Functions | Static Public Member Functions | Private Member Functions | Static Private Attributes
nux::DisplayAccessController Class Reference

#include <GLWindowManager.h>

Collaboration diagram for nux::DisplayAccessController:
Collaboration graph

List of all members.

Public Member Functions

GraphicsDisplayCreateGLWindow (const char *WindowTitle, unsigned int WindowWidth, unsigned int WindowHeight, WindowStyle Style, GraphicsDisplay *parent, bool FullscreenFlag=false, bool create_rendering_data=true)
 Create a graphics window capable of doing OpenGL rendering.

Static Public Member Functions

static DisplayAccessControllerInstance ()

Private Member Functions

 DisplayAccessController ()
 DisplayAccessController (const DisplayAccessController &)
DisplayAccessControlleroperator= (const DisplayAccessController &)
DisplayAccessControlleroperator& ()
 ~DisplayAccessController ()

Static Private Attributes

static DisplayAccessControllerm_pInstance = 0

Detailed Description

Definition at line 42 of file GLWindowManager.h.

Constructor & Destructor Documentation

Definition at line 36 of file GLWindowManager.cpp.

#if defined(NUX_OS_WINDOWS)
    // Register Windows Class

    // Get hInstance of current application.
    if (gInstance == 0)
      hInstance = GetModuleHandle(NULL);
      hInstance = gInstance;

    WinClass.cbSize         = sizeof(WNDCLASSEX);
    //  CS_CLASSDC      Specifies that one device context is shared between all windows created with this class.
    //  CS_DBLCLKS      This is needed if you want to be able to detect double mouse clicks made on the window.
    //  CS_HREDRAW      The window is redrawn if there is a change in the window's width or if the window is moved horizontally.
    //  CS_NOCLOSE      Disables the close option on the window menu.
    //  CS_OWNDC        A unique device context is created for each window created. This is the opposite to CS_CLASSDC.
    //  CS_PARENTDC     This sets the clipping rectangle of the child window to that of the parent window. This allows the child window to be able to draw on the parent window.
    //  CS_VREDRAW      The window is redrawn if there is a change in the window's height or if the window is moved vertically.                 = CS_HREDRAW | CS_VREDRAW | CS_OWNDC | CS_DBLCLKS;      // Redraw On Size, And Own DC For Window.
    WinClass.lpfnWndProc    = (WNDPROC) WndProcManager;                      // WndProc Handles Messages
    WinClass.cbClsExtra     = 0;                                                           // No Extra Window Data
    WinClass.cbWndExtra     = 0;                                                           // No Extra Window Data
    WinClass.hInstance      = hInstance;                                            // Set The Instance
    WinClass.hIcon          = LoadIcon(hInstance, "IDI_INALOGIC"); //LoadIcon(NULL, IDI_WINLOGO);               // Load The Default Icon
    WinClass.hCursor        = LoadCursor(NULL, IDC_ARROW);                   // Class cursor: Load The Arrow Pointer
    WinClass.hbrBackground  = NULL; //(HBRUSH)GetStockObject(BLACK_BRUSH);  // No Background Required For GL
    WinClass.lpszMenuName   = NULL;                                                               // We Don't Want A Menu
    WinClass.lpszClassName  = WINDOW_CLASS_NAME; //gClassName;                                           // Set The Class Name
    WinClass.hIconSm        = LoadIcon(hInstance, "IDI_INALOGIC");

    if (!RegisterClassEx(&WinClass))                                                              // Attempt To Register The Window Class
      nuxCriticalMsg("[DisplayAccessController::~DisplayAccessController] Failed to register window class name: %s.", WINDOW_CLASS_NAME);



Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 76 of file GLWindowManager.cpp.

#if defined(NUX_OS_WINDOWS)

    if (!UnregisterClass(WINDOW_CLASS_NAME, hInstance))               // Are We Able To Unregister Class
      nuxDebugMsg("[DisplayAccessController::~DisplayAccessController] Failed to unregister window class name: %s.", WINDOW_CLASS_NAME);
      hInstance = NULL;                                                                   // Set hInstance To NULL


Member Function Documentation

GraphicsDisplay * nux::DisplayAccessController::CreateGLWindow ( const char *  WindowTitle,
unsigned int  WindowWidth,
unsigned int  WindowHeight,
WindowStyle  Style,
GraphicsDisplay parent,
bool  FullscreenFlag = false,
bool  create_rendering_data = true 

Create a graphics window capable of doing OpenGL rendering.

WindowTitleThe title name of the window.
WindowWidthWindow width.
WindowHeightWindow height.
StyleWindow style.
parentThe parent window.
FullscreenFlagTrue to create a full screen window.
create_rendering_dataIf true, then in GraphicsEngine, the system creates the OpenGL shaders and the font textures for the rendering.

Definition at line 99 of file GLWindowManager.cpp.

    if (GetGraphicsDisplay())
      // A GlWindow already exist for this thread.
      nuxAssertMsg(0, "Only one GLWindow per thread is allowed");
      return 0;

    GraphicsDisplay *glwindow = new GraphicsDisplay();
    glwindow->CreateOpenGLWindow(WindowTitle, WindowWidth, WindowHeight, Style, GLWindow, FullscreenFlag, create_rendering_data);

    return glwindow;

Here is the call graph for this function:

Definition at line 89 of file GLWindowManager.cpp.

    if (m_pInstance == 0)
      m_pInstance = new DisplayAccessController();

    return *m_pInstance;

Here is the call graph for this function:

DisplayAccessController* nux::DisplayAccessController::operator& ( ) [private]
DisplayAccessController& nux::DisplayAccessController::operator= ( const DisplayAccessController ) [private]

Member Data Documentation

Definition at line 81 of file GLWindowManager.h.

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