Sparkle 0.0.1
Loading...
Searching...
No Matches
spk::OpenGL::WglContext Class Reference

Manages a Windows WGL OpenGL context tied to a window. More...

#include <spk_wgl_context.hpp>

Collaboration diagram for spk::OpenGL::WglContext:
Collaboration graph

Classes

struct  Version
 Desired OpenGL major/minor version numbers. More...

Public Member Functions

 WglContext (Win32::Window &p_window, Version p_version)
 Creates an OpenGL context for a window with a desired version.
 WglContext (const WglContext &)=delete
WglContextoperator= (const WglContext &)=delete
 WglContext (WglContext &&)=delete
WglContextoperator= (WglContext &&)=delete
void makeCurrent ()
 Activates this context on the current thread.
void releaseCurrent ()
 Releases this context from the current thread.
void clear ()
 Clears using the current ViewRegion settings.
void resize (const spk::Extend2D &p_extend2D)
 Resizes viewport to match new client size.
void swap ()
 Swaps buffers.
HandleDeviceContext deviceContext () const noexcept
 Access to device context handle.
HandleRenderingContext renderingContext () const noexcept
 Access to rendering context handle.

Detailed Description

Manages a Windows WGL OpenGL context tied to a window.

Constructor & Destructor Documentation

◆ WglContext()

spk::OpenGL::WglContext::WglContext ( Win32::Window & p_window,
Version p_version )

Creates an OpenGL context for a window with a desired version.

Parameters
p_windowTarget window.
p_versionOpenGL version.

Member Function Documentation

◆ deviceContext()

WglContext::HandleDeviceContext spk::OpenGL::WglContext::deviceContext ( ) const
noexcept

Access to device context handle.

Returns
HDC.

◆ renderingContext()

WglContext::HandleRenderingContext spk::OpenGL::WglContext::renderingContext ( ) const
noexcept

Access to rendering context handle.

Returns
HGLRC.

◆ resize()

void spk::OpenGL::WglContext::resize ( const spk::Extend2D & p_extend2D)

Resizes viewport to match new client size.

Parameters
p_extend2DNew dimensions.

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