# Visualization Library

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

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

Public Member Functions

# vlWX::WXGLCanvas Class Reference

The WXGLCanvas class implements a vl::OpenGLContext using the wxWidgets library. More...

`#include <WXGLCanvas.hpp>`

Inheritance diagram for vlWX::WXGLCanvas:

List of all members.

## Public Member Functions

| WXGLCanvas (wxWindow *parent, const wxGLContext *shared, wxWindowID id=wxID_ANY, const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxDefaultSize, long style=0, int *attribList=0, const wxString &name=wxT("WXGLCanvas"), const wxPalette &palette=wxNullPalette)
| ~WXGLCanvas ()
void | OnPaint (wxPaintEvent &ev)
void | OnSize (wxSizeEvent &ev)
void | OnEraseBackground (wxEraseEvent &ev)
void | OnKeyDown (wxKeyEvent &ev)
void | OnKeyUp (wxKeyEvent &ev)
void | OnMouseMotion (wxMouseEvent &ev)
void | OnMouseDown (wxMouseEvent &ev)
void | OnMouseUp (wxMouseEvent &ev)
void | OnMouseWheel (wxMouseEvent &ev)
void | OnMouseEnter (wxMouseEvent &ev)
void | OnIdle (wxIdleEvent &ev)
void | OnDropFiles (wxDropFilesEvent &ev)
bool | setFullscreen (bool fullscreen)
| If the OpenGL context is a widget this function requests a maximization to fullscreen.
void | quitApplication ()
| Asks to the windowing system that is managing the OpenGLContext to quit the application.
void | makeCurrent ()
| Sets the OpenGL context as current for the calling thread.
void | swapBuffers ()
| Swaps the back and front buffers to present the last rendering.
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.
void | update ()
| If the OpenGLContext is a widget this function requests a redraw and generates an updateEvent().
void | setWindowTitle (const vl::String &text)
| 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 | 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.
vl::ivec2 | position () const
| If the OpenGL context is a widget this function returns its position.
void | setMouseVisible (bool visible)
| If the OpenGL context is a widget this function sets whether the mouse is visible over it or not.

## Detailed Description

The WXGLCanvas class implements a vl::OpenGLContext using the wxWidgets library.

Definition at line 52 of file WXGLCanvas.hpp.

## Constructor & Destructor Documentation

WXGLCanvas::WXGLCanvas | ( | wxWindow * | parent,
|  | const wxGLContext * | shared,
|  | wxWindowID | id = `wxID_ANY`,
|  | const wxPoint & | pos = `wxDefaultPosition`,
|  | const wxSize & | size = `wxDefaultSize`,
|  | long | style = `0`,
|  | int * | attribList = `0`,
|  | const wxString & | name = `wxT("WXGLCanvas")`,
|  | const wxPalette & | palette = `wxNullPalette`
| ) |  |

Definition at line 66 of file WXGLCanvas.cpp.

References vl::Object::setAutomaticDelete().

WXGLCanvas::~WXGLCanvas | ( | ) |

Definition at line 61 of file WXGLCanvas.cpp.

## Member Function Documentation

void WXGLCanvas::OnPaint | ( | wxPaintEvent & | ev ) |

Definition at line 317 of file WXGLCanvas.cpp.

References vl::OpenGLContext::dispatchRunEvent(), makeCurrent(), and swapBuffers().

void WXGLCanvas::OnSize | ( | wxSizeEvent & | ev ) |

Definition at line 158 of file WXGLCanvas.cpp.

References vl::OpenGLContext::dispatchResizeEvent().

void WXGLCanvas::OnEraseBackground | ( | wxEraseEvent & | ev ) |

Definition at line 337 of file WXGLCanvas.cpp.

void WXGLCanvas::OnKeyDown | ( | wxKeyEvent & | ev ) |

Definition at line 298 of file WXGLCanvas.cpp.

References vl::OpenGLContext::dispatchKeyPressEvent(), vl::Key_Unknown, and translateKey().

void WXGLCanvas::OnKeyUp | ( | wxKeyEvent & | ev ) |

Definition at line 308 of file WXGLCanvas.cpp.

References vl::OpenGLContext::dispatchKeyReleaseEvent(), vl::Key_Unknown, and translateKey().

void WXGLCanvas::OnMouseMotion | ( | wxMouseEvent & | ev ) |

Definition at line 109 of file WXGLCanvas.cpp.

References vl::OpenGLContext::dispatchMouseMoveEvent().

void WXGLCanvas::OnMouseDown | ( | wxMouseEvent & | ev ) |

Definition at line 139 of file WXGLCanvas.cpp.

References vl::OpenGLContext::dispatchMouseDownEvent(), vl::LeftButton, vl::MiddleButton, vl::RightButton, vl::UnknownButton, and VL_CHECK.

void WXGLCanvas::OnMouseUp | ( | wxMouseEvent & | ev ) |

Definition at line 120 of file WXGLCanvas.cpp.

References vl::OpenGLContext::dispatchMouseUpEvent(), vl::LeftButton, vl::MiddleButton, vl::RightButton, vl::UnknownButton, and VL_CHECK.

void WXGLCanvas::OnMouseWheel | ( | wxMouseEvent & | ev ) |

Definition at line 114 of file WXGLCanvas.cpp.

References vl::OpenGLContext::dispatchMouseWheelEvent().

void vlWX::WXGLCanvas::OnMouseEnter | ( | wxMouseEvent & | ev ) |

void WXGLCanvas::OnIdle | ( | wxIdleEvent & | ev ) |

Definition at line 96 of file WXGLCanvas.cpp.

References vl::OpenGLContext::continuousUpdate().

void WXGLCanvas::OnDropFiles | ( | wxDropFilesEvent & | ev ) |

Definition at line 84 of file WXGLCanvas.cpp.

References vl::OpenGLContext::dispatchFileDroppedEvent().

bool WXGLCanvas::setFullscreen | ( | bool | ) | `[virtual]`

If the OpenGL context is a widget this function requests a maximization to fullscreen.

Reimplemented from vl::OpenGLContext.

Definition at line 342 of file WXGLCanvas.cpp.

References vl::OpenGLContext::fullscreen(), and vl::OpenGLContext::mFullscreen.

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

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

Reimplemented from vl::OpenGLContext.

Definition at line 359 of file WXGLCanvas.cpp.

References vl::OpenGLContext::eraseAllEventListeners().

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

Sets the OpenGL context as current for the calling thread.

Implements vl::OpenGLContext.

Definition at line 367 of file WXGLCanvas.cpp.

Referenced by OnPaint().

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

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

Implements vl::OpenGLContext.

Definition at line 376 of file WXGLCanvas.cpp.

Referenced by OnPaint().

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

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

Reimplemented from vl::OpenGLContext.

Definition at line 385 of file WXGLCanvas.cpp.

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

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

Reimplemented from vl::OpenGLContext.

Definition at line 390 of file WXGLCanvas.cpp.

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

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

Implements vl::OpenGLContext.

Definition at line 395 of file WXGLCanvas.cpp.

void WXGLCanvas::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 400 of file WXGLCanvas.cpp.

References vl::String::toStdString(), and vl::String::toStdWString().

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

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

Reimplemented from vl::OpenGLContext.

Definition at line 412 of file WXGLCanvas.cpp.

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

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

Reimplemented from vl::OpenGLContext.

Definition at line 417 of file WXGLCanvas.cpp.

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

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

Reimplemented from vl::OpenGLContext.

Definition at line 422 of file WXGLCanvas.cpp.

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

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

Reimplemented from vl::OpenGLContext.

Definition at line 427 of file WXGLCanvas.cpp.

ivec2 WXGLCanvas::position | ( | ) | const`[virtual]`

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

Reimplemented from vl::OpenGLContext.

Definition at line 432 of file WXGLCanvas.cpp.

void WXGLCanvas::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 438 of file WXGLCanvas.cpp.

References vl::OpenGLContext::mMouseVisible, and vl::OpenGLContext::mouseVisible().

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

- D:/VL/BuildSystem/VL_DISTRO/Visualization_Library_SDK/src/vlWX/WXGLCanvas.hpp
- D:/VL/BuildSystem/VL_DISTRO/Visualization_Library_SDK/src/vlWX/WXGLCanvas.cpp

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