# Visualization Library

A lightweight C++ OpenGL middleware for 2D/3D graphics

[Home] [Tutorials] [All Classes] [Grouped Classes]

Public Member Functions | Static Public Member Functions | Static Public Attributes | Protected Attributes | Static Protected Attributes

# vlEGL::EGLWindow Class Reference

The EGLWindow class is a EGLContext that can be used as a top or child window. More...

`#include <EGLWindow.hpp>`

Inheritance diagram for vlEGL::EGLWindow:

List of all members.

## Public Member Functions

| EGLWindow ()
| ~EGLWindow ()
void | swapBuffers ()
| Swaps the back and front buffers to present the last rendering.
void | makeCurrent ()
| Sets the OpenGL context as current for the calling thread.
void | update ()
| If the OpenGLContext is a widget this function requests a redraw and generates an updateEvent().
void | quitApplication ()
| Asks to the windowing system that is managing the OpenGLContext to quit the application.
void | setMouseVisible (bool visible)
| If the OpenGL context is a widget this function sets whether the mouse is visible over it or not.
void | setPosition (int x, int y)
| If the OpenGL context is a widget this function sets its position.
void | setSize (int w, int h)
| If the OpenGL context is a widget this function sets its size.
void | setWindowSize (int w, int h)
vl::ivec2 | position () const
| If the OpenGL context is a widget this function returns its position.
vl::ivec2 | windowSize () const
vl::ivec2 | size () const
void | setWindowTitle (const vl::String &title)
| If the OpenGL context is a top window this function sets its title.
void | show ()
| If the OpenGL context is a widget this function makes it visible to the user.
void | hide ()
| If the OpenGL context is a widget this function makes it invisible to the user.
void | getFocus ()
| If the OpenGL context is a widget this function requests the mouse focus on it.
void | setMousePosition (int x, int y)
| If the OpenGL context is a widget this function sets the mouse position.
bool | initEGLWindow (HWND parent, const vl::String &title, const vl::OpenGLContextFormat &fmt, int x=0, int y=0, int width=640, int height=480)
| Initializes a new EGL window with a new OpenGL rendering context.
void | destroyEGLGLWindow ()
| Destroys the window and the OpenGL rendering context.
HWND | hwnd () const
DWORD | style () const
| The dwExStyle parameter passed to the EGL function CreateWindowEx.
void | setStyle (DWORD style)
| The dwExStyle parameter passed to the EGL function CreateWindowEx.
DWORD | exStyle () const
| The dwStyle parameter passed to the EGL function CreateWindowEx.
void | setExStyle (DWORD ex_style)
| The dwStyle parameter passed to the EGL function CreateWindowEx.
const wchar_t * | windowClassName () const
| Specifies the value given to the lpClassName parameter passed to CreateWindowEx.
void | setWindowClassName (const wchar_t *name)
| Specifies the value given to the lpClassName parameter passed to CreateWindowEx.
const EGLDisplay & | eglDisplay () const
const EGLContext & | eglContext () const
const EGLSurface & | eglSurface () const

## Static Public Member Functions

static LONG WINAPI | WindowProc (HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
static EGLWindow * | getWindow (HWND hWnd)
| Returns when a WM_QUIT message is sent or when no more windows are alive.
static const std::map< HWND, EGLWindow * > & | winMap ()

## Static Public Attributes

static const wchar_t * | EGLWindowClassName = "VisualizationLibraryWindowClass"

## Protected Attributes

int | mMouseDownCount
HWND | mHWND
DWORD | mStyle
DWORD | mExStyle
const wchar_t * | mWindowClassName
EGLDisplay | mEGL_Display
EGLContext | mEGL_Context
EGLSurface | mEGL_Surface

## Static Protected Attributes

static std::map< HWND, EGLWindow * > | mWinMap

## Detailed Description

The EGLWindow class is a EGLContext that can be used as a top or child window.

Definition at line 52 of file EGLWindow.hpp.

## Constructor & Destructor Documentation

EGLWindow::EGLWindow | ( | ) |

Definition at line 252 of file EGLWindow.cpp.

References NULL.

EGLWindow::~EGLWindow | ( | ) |

Definition at line 266 of file EGLWindow.cpp.

## Member Function Documentation

LONG WINAPI EGLWindow::WindowProc | ( | HWND | hWnd,
|  | UINT | uMsg,
|  | WPARAM | wParam,
|  | LPARAM | lParam
| ) |  | `[static]`

Definition at line 103 of file EGLWindow.cpp.

References destroyEGLGLWindow(), vl::OpenGLContext::dispatchDestroyEvent(), vl::OpenGLContext::dispatchFileDroppedEvent(), vl::OpenGLContext::dispatchKeyPressEvent(), vl::OpenGLContext::dispatchKeyReleaseEvent(), vl::OpenGLContext::dispatchMouseDownEvent(), vl::OpenGLContext::dispatchMouseMoveEvent(), vl::OpenGLContext::dispatchMouseUpEvent(), vl::OpenGLContext::dispatchMouseWheelEvent(), vl::OpenGLContext::dispatchResizeEvent(), vl::OpenGLContext::dispatchRunEvent(), eglContext(), eglSurface(), vl::OpenGLContext::framebuffer(), hwnd(), vl::Key_None, vl::LeftButton, vl::MiddleButton, mMouseDownCount, vl::RightButton, vl::Framebuffer::setHeight(), vl::Framebuffer::setWidth(), vlEGL::translateKeyEvent(), and vl::UnknownButton.

void EGLWindow::swapBuffers | ( | ) | `[virtual]`

Swaps the back and front buffers to present the last rendering.

Implements vl::OpenGLContext.

Definition at line 391 of file EGLWindow.cpp.

References vl::Log::error().

void EGLWindow::makeCurrent | ( | ) | `[virtual]`

Sets the OpenGL context as current for the calling thread.

Implements vl::OpenGLContext.

Definition at line 400 of file EGLWindow.cpp.

References vl::Log::error().

void EGLWindow::update | ( | ) | `[virtual]`

If the OpenGLContext is a widget this function requests a redraw and generates an updateEvent().

Implements vl::OpenGLContext.

Definition at line 408 of file EGLWindow.cpp.

Referenced by vlEGL::dispatchUpdate().

void EGLWindow::quitApplication | ( | ) | `[virtual]`

Asks to the windowing system that is managing the OpenGLContext to quit the application.

Reimplemented from vl::OpenGLContext.

Definition at line 414 of file EGLWindow.cpp.

void EGLWindow::setMouseVisible | ( | bool | ) | `[virtual]`

If the OpenGL context is a widget this function sets whether the mouse is visible over it or not.

Reimplemented from vl::OpenGLContext.

Definition at line 419 of file EGLWindow.cpp.

void EGLWindow::setPosition | ( | int | ,
|  | int |
| ) |  | `[virtual]`

If the OpenGL context is a widget this function sets its position.

Reimplemented from vl::OpenGLContext.

Definition at line 428 of file EGLWindow.cpp.

void EGLWindow::setSize | ( | int | ,
|  | int |
| ) |  | `[virtual]`

If the OpenGL context is a widget this function sets its size.

Reimplemented from vl::OpenGLContext.

Definition at line 434 of file EGLWindow.cpp.

void EGLWindow::setWindowSize | ( | int | w,
|  | int | h
| ) |  |

Definition at line 447 of file EGLWindow.cpp.

vl::ivec2 EGLWindow::position | ( | ) | const`[virtual]`

If the OpenGL context is a widget this function returns its position.

Reimplemented from vl::OpenGLContext.

Definition at line 456 of file EGLWindow.cpp.

vl::ivec2 EGLWindow::windowSize | ( | ) | const

Definition at line 464 of file EGLWindow.cpp.

vl::ivec2 EGLWindow::size | ( | ) | const

Definition at line 472 of file EGLWindow.cpp.

void EGLWindow::setWindowTitle | ( | const vl::String & | ) | `[virtual]`

If the OpenGL context is a top window this function sets its title.

Reimplemented from vl::OpenGLContext.

Definition at line 480 of file EGLWindow.cpp.

References vl::String::ptr().

void EGLWindow::show | ( | ) | `[virtual]`

If the OpenGL context is a widget this function makes it visible to the user.

Reimplemented from vl::OpenGLContext.

Definition at line 486 of file EGLWindow.cpp.

void EGLWindow::hide | ( | ) | `[virtual]`

If the OpenGL context is a widget this function makes it invisible to the user.

Reimplemented from vl::OpenGLContext.

Definition at line 492 of file EGLWindow.cpp.

void EGLWindow::getFocus | ( | ) | `[virtual]`

If the OpenGL context is a widget this function requests the mouse focus on it.

Reimplemented from vl::OpenGLContext.

Definition at line 498 of file EGLWindow.cpp.

void EGLWindow::setMousePosition | ( | int | ,
|  | int |
| ) |  | `[virtual]`

If the OpenGL context is a widget this function sets the mouse position.

Reimplemented from vl::OpenGLContext.

Definition at line 504 of file EGLWindow.cpp.

bool EGLWindow::initEGLWindow | ( | HWND | parent,
|  | const vl::String & | title,
|  | const vl::OpenGLContextFormat & | fmt,
|  | int | x = `0`,
|  | int | y = `0`,
|  | int | width = `640`,
|  | int | height = `480`
| ) |  |

Initializes a new EGL window with a new OpenGL rendering context.

After the initialization to show the window use the show() method.

Definition at line 271 of file EGLWindow.cpp.

References vl::Vector4< T_Scalar >::a(), vl::Vector4< T_Scalar >::b(), vl::OpenGLContextFormat::contextClientVersion(), vl::OpenGLContextFormat::depthBufferBits(), vl::Vector4< T_Scalar >::g(), vl::OpenGLContextFormat::multisample(), vl::OpenGLContextFormat::multisampleSamples(), NULL, vl::Vector4< T_Scalar >::r(), vlWin32::registerClass(), vl::OpenGLContextFormat::rgbaBits(), vl::OpenGLContextFormat::stencilBufferBits(), and vl::OpenGLContextFormat::vSync().

void EGLWindow::destroyEGLGLWindow | ( | ) |

Destroys the window and the OpenGL rendering context.

Definition at line 523 of file EGLWindow.cpp.

References NULL.

Referenced by WindowProc().

HWND vlEGL::EGLWindow::hwnd | ( | ) | const`[inline]`

Definition at line 88 of file EGLWindow.hpp.

Referenced by WindowProc().

DWORD vlEGL::EGLWindow::style | ( | ) | const`[inline]`

The dwExStyle parameter passed to the EGL function CreateWindowEx.

Definition at line 91 of file EGLWindow.hpp.

void vlEGL::EGLWindow::setStyle | ( | DWORD | style ) | `[inline]`

The dwExStyle parameter passed to the EGL function CreateWindowEx.

Definition at line 94 of file EGLWindow.hpp.

DWORD vlEGL::EGLWindow::exStyle | ( | ) | const`[inline]`

The dwStyle parameter passed to the EGL function CreateWindowEx.

Definition at line 97 of file EGLWindow.hpp.

void vlEGL::EGLWindow::setExStyle | ( | DWORD | ex_style ) | `[inline]`

The dwStyle parameter passed to the EGL function CreateWindowEx.

Definition at line 100 of file EGLWindow.hpp.

const wchar_t* vlEGL::EGLWindow::windowClassName | ( | ) | const`[inline]`

Specifies the value given to the lpClassName parameter passed to CreateWindowEx.

Definition at line 103 of file EGLWindow.hpp.

void vlEGL::EGLWindow::setWindowClassName | ( | const wchar_t * | name ) | `[inline]`

Specifies the value given to the lpClassName parameter passed to CreateWindowEx.

Definition at line 106 of file EGLWindow.hpp.

const EGLDisplay& vlEGL::EGLWindow::eglDisplay | ( | ) | const`[inline]`

Definition at line 108 of file EGLWindow.hpp.

const EGLContext& vlEGL::EGLWindow::eglContext | ( | ) | const`[inline]`

Definition at line 109 of file EGLWindow.hpp.

Referenced by WindowProc().

const EGLSurface& vlEGL::EGLWindow::eglSurface | ( | ) | const`[inline]`

Definition at line 110 of file EGLWindow.hpp.

Referenced by WindowProc().

EGLWindow * EGLWindow::getWindow | ( | HWND | hWnd ) | `[static]`

Returns when a WM_QUIT message is sent or when no more windows are alive.

Definition at line 514 of file EGLWindow.cpp.

References NULL.

static const std::map< HWND, EGLWindow* >& vlEGL::EGLWindow::winMap | ( | ) | `[inline, static]`

Definition at line 128 of file EGLWindow.hpp.

## Member Data Documentation

const wchar_t * EGLWindow::EGLWindowClassName = "VisualizationLibraryWindowClass"`[static]`

Definition at line 55 of file EGLWindow.hpp.

int vlEGL::EGLWindow::mMouseDownCount`[protected]`

Definition at line 113 of file EGLWindow.hpp.

Referenced by WindowProc().

HWND vlEGL::EGLWindow::mHWND`[protected]`

Definition at line 114 of file EGLWindow.hpp.

DWORD vlEGL::EGLWindow::mStyle`[protected]`

Definition at line 115 of file EGLWindow.hpp.

DWORD vlEGL::EGLWindow::mExStyle`[protected]`

Definition at line 116 of file EGLWindow.hpp.

const wchar_t* vlEGL::EGLWindow::mWindowClassName`[protected]`

Definition at line 117 of file EGLWindow.hpp.

EGLDisplay vlEGL::EGLWindow::mEGL_Display`[protected]`

Definition at line 119 of file EGLWindow.hpp.

EGLContext vlEGL::EGLWindow::mEGL_Context`[protected]`

Definition at line 120 of file EGLWindow.hpp.

EGLSurface vlEGL::EGLWindow::mEGL_Surface`[protected]`

Definition at line 121 of file EGLWindow.hpp.

std::map< HWND, EGLWindow * > EGLWindow::mWinMap`[static, protected]`

Definition at line 131 of file EGLWindow.hpp.

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

- D:/VL/BuildSystem/VL_DISTRO/Visualization_Library_SDK/src/vlEGL/EGLWindow.hpp
- D:/VL/BuildSystem/VL_DISTRO/Visualization_Library_SDK/src/vlEGL/EGLWindow.cpp

Visualization Library v2011.09.1162 Reference Documentation
Copyright 2005-2011 Michele Bosi. All rights reserved.
Updated on Thu Jan 26 2012 00:45:01.
Permission is granted to use this page to write and publish articles regarding Visualization Library.