ResidualVM logo ResidualVM website - Forums - Contact us BuildBot - Doxygen - Wiki curved edge

OpenGLSdlGraphicsManager Class Reference

SDL OpenGL based graphics manager. More...

#include <openglsdl-graphics.h>

Inheritance diagram for OpenGLSdlGraphicsManager:
Collaboration diagram for OpenGLSdlGraphicsManager:

List of all members.

Classes

struct  Capabilities
 Capabilities of the current device. More...
struct  OpenGLPixelFormat

Public Member Functions

 OpenGLSdlGraphicsManager (SdlEventSource *eventSource, SdlWindow *window, const Capabilities &capabilities)
virtual ~OpenGLSdlGraphicsManager ()
virtual bool hasFeature (OSystem::Feature f) const override
virtual bool getFeatureState (OSystem::Feature f) const override
virtual void setFeatureState (OSystem::Feature f, bool enable) override
virtual Graphics::PixelFormat getScreenFormat () const override
virtual int getScreenChangeID () const override
virtual void setupScreen (uint gameWidth, uint gameHeight, bool fullscreen, bool accel3d) override
virtual Graphics::PixelBuffer getScreenPixelBuffer () override
virtual int16 getHeight () const override
virtual int16 getWidth () const override
virtual void updateScreen ()
virtual void showOverlay () override
virtual void hideOverlay () override
virtual Graphics::PixelFormat getOverlayFormat () const override
virtual void clearOverlay () override
virtual void grabOverlay (void *buf, int pitch) const override
virtual void copyRectToOverlay (const void *buf, int pitch, int x, int y, int w, int h) override
int16 getOverlayWidth () const override
int16 getOverlayHeight () const override
virtual void suggestSideTextures (Graphics::Surface *left, Graphics::Surface *right) override
virtual void warpMouse (int x, int y) override
virtual void transformMouseCoordinates (Common::Point &point) override
 Transforms real screen coordinates into the current active screen coordinates (may be either game screen or overlay).
void notifyResize (const int width, const int height) override
 Notify the graphics manager about a resize event.

Protected Member Functions

bool createOrUpdateGLContext (uint gameWidth, uint gameHeight, uint effectiveWidth, uint effectiveHeight, bool renderToFramebuffer, bool engineSupportsArbitraryResolutions)
 Initialize an OpenGL window matching as closely as possible the required properties.
void createOrUpdateScreen ()
Math::Rect2d computeGameRect (bool renderToFrameBuffer, uint gameWidth, uint gameHeight, uint screenWidth, uint screenHeight)
 Compute the size and position of the game rectangle in the screen.
virtual bool saveScreenshot (const Common::String &filename) const override
 Save a screenshot to the specified file.
virtual int getGraphicsModeScale (int mode) const override
void initializeOpenGLContext () const
void drawOverlay ()
void drawSideTextures ()
void closeOverlay ()
OpenGL::FrameBuffercreateFramebuffer (uint width, uint height)
bool shouldRenderToFramebuffer () const
bool isVSyncEnabled () const

Protected Attributes

const Capabilities_capabilities
Math::Rect2d _gameRect
uint _engineRequestedWidth
uint _engineRequestedHeight
int _screenChangeCount
int _antialiasing
bool _vsync
bool _fullscreen
bool _lockAspectRatio
bool _overlayVisible
OpenGL::TiledSurface_overlayScreen
OpenGL::TiledSurface_overlayBackground
OpenGL::Texture_sideTextures [2]
OpenGL::SurfaceRenderer_surfaceRenderer
Graphics::PixelFormat _overlayFormat
Graphics::PixelFormat _screenFormat
OpenGL::FrameBuffer_frameBuffer

Detailed Description

SDL OpenGL based graphics manager.

Used when rendering games with OpenGL

Definition at line 40 of file openglsdl-graphics.h.


Constructor & Destructor Documentation

OpenGLSdlGraphicsManager::OpenGLSdlGraphicsManager ( SdlEventSource eventSource,
SdlWindow window,
const Capabilities capabilities 
)

Definition at line 47 of file openglsdl-graphics.cpp.

OpenGLSdlGraphicsManager::~OpenGLSdlGraphicsManager (  )  [virtual]

Definition at line 72 of file openglsdl-graphics.cpp.


Member Function Documentation

void OpenGLSdlGraphicsManager::clearOverlay (  )  [override, virtual]

Definition at line 633 of file openglsdl-graphics.cpp.

void OpenGLSdlGraphicsManager::closeOverlay (  )  [protected]

Definition at line 650 of file openglsdl-graphics.cpp.

Math::Rect2d OpenGLSdlGraphicsManager::computeGameRect ( bool  renderToFrameBuffer,
uint  gameWidth,
uint  gameHeight,
uint  screenWidth,
uint  screenHeight 
) [protected]

Compute the size and position of the game rectangle in the screen.

Definition at line 263 of file openglsdl-graphics.cpp.

void OpenGLSdlGraphicsManager::copyRectToOverlay ( const void *  buf,
int  pitch,
int  x,
int  y,
int  w,
int  h 
) [override, virtual]

Definition at line 629 of file openglsdl-graphics.cpp.

OpenGL::FrameBuffer * OpenGLSdlGraphicsManager::createFramebuffer ( uint  width,
uint  height 
) [protected]

Definition at line 521 of file openglsdl-graphics.cpp.

bool OpenGLSdlGraphicsManager::createOrUpdateGLContext ( uint  gameWidth,
uint  gameHeight,
uint  effectiveWidth,
uint  effectiveHeight,
bool  renderToFramebuffer,
bool  engineSupportsArbitraryResolutions 
) [protected]

Initialize an OpenGL window matching as closely as possible the required properties.

When unable to create a context with anti-aliasing this tries without. When unable to create a context with the desired pixel depth this tries lower values.

Definition at line 346 of file openglsdl-graphics.cpp.

void OpenGLSdlGraphicsManager::createOrUpdateScreen (  )  [protected]

Definition at line 190 of file openglsdl-graphics.cpp.

void OpenGLSdlGraphicsManager::drawOverlay (  )  [protected]

Definition at line 482 of file openglsdl-graphics.cpp.

void OpenGLSdlGraphicsManager::drawSideTextures (  )  [protected]

Definition at line 499 of file openglsdl-graphics.cpp.

bool OpenGLSdlGraphicsManager::getFeatureState ( OSystem::Feature  f  )  const [override, virtual]

Definition at line 91 of file openglsdl-graphics.cpp.

virtual int OpenGLSdlGraphicsManager::getGraphicsModeScale ( int  mode  )  const [inline, override, protected, virtual]

Implements ResVmSdlGraphicsManager.

Definition at line 141 of file openglsdl-graphics.h.

int16 OpenGLSdlGraphicsManager::getHeight (  )  const [override, virtual]

Definition at line 565 of file openglsdl-graphics.cpp.

virtual Graphics::PixelFormat OpenGLSdlGraphicsManager::getOverlayFormat (  )  const [inline, override, virtual]

Definition at line 81 of file openglsdl-graphics.h.

int16 OpenGLSdlGraphicsManager::getOverlayHeight (  )  const [override]

Definition at line 669 of file openglsdl-graphics.cpp.

int16 OpenGLSdlGraphicsManager::getOverlayWidth (  )  const [override]

Definition at line 673 of file openglsdl-graphics.cpp.

virtual int OpenGLSdlGraphicsManager::getScreenChangeID (  )  const [inline, override, virtual]

Definition at line 69 of file openglsdl-graphics.h.

virtual Graphics::PixelFormat OpenGLSdlGraphicsManager::getScreenFormat (  )  const [inline, override, virtual]

Definition at line 67 of file openglsdl-graphics.h.

Graphics::PixelBuffer OpenGLSdlGraphicsManager::getScreenPixelBuffer (  )  [override, virtual]

Definition at line 314 of file openglsdl-graphics.cpp.

int16 OpenGLSdlGraphicsManager::getWidth (  )  const [override, virtual]

Definition at line 573 of file openglsdl-graphics.cpp.

void OpenGLSdlGraphicsManager::grabOverlay ( void *  buf,
int  pitch 
) const [override, virtual]

Definition at line 637 of file openglsdl-graphics.cpp.

bool OpenGLSdlGraphicsManager::hasFeature ( OSystem::Feature  f  )  const [override, virtual]

Definition at line 79 of file openglsdl-graphics.cpp.

void OpenGLSdlGraphicsManager::hideOverlay (  )  [override, virtual]

Definition at line 619 of file openglsdl-graphics.cpp.

void OpenGLSdlGraphicsManager::initializeOpenGLContext (  )  const [protected]

Definition at line 318 of file openglsdl-graphics.cpp.

bool OpenGLSdlGraphicsManager::isVSyncEnabled (  )  const [protected]

Definition at line 472 of file openglsdl-graphics.cpp.

void OpenGLSdlGraphicsManager::notifyResize ( const int  width,
const int  height 
) [override, virtual]

Notify the graphics manager about a resize event.

It is noteworthy that the requested width/height should actually be set up as is and not changed by the graphics manager, since otherwise it may lead to odd behavior for certain window managers.

It is only required to overwrite this method in case you want a resizable window. The default implementation just does nothing.

Parameters:
width Requested window width.
height Requested window height.

Reimplemented from SdlGraphicsManager.

Definition at line 284 of file openglsdl-graphics.cpp.

bool OpenGLSdlGraphicsManager::saveScreenshot ( const Common::String file  )  const [override, protected, virtual]

Save a screenshot to the specified file.

Implements ResVmSdlGraphicsManager.

Definition at line 714 of file openglsdl-graphics.cpp.

void OpenGLSdlGraphicsManager::setFeatureState ( OSystem::Feature  f,
bool  enable 
) [override, virtual]

Definition at line 104 of file openglsdl-graphics.cpp.

void OpenGLSdlGraphicsManager::setupScreen ( uint  gameWidth,
uint  gameHeight,
bool  fullscreen,
bool  accel3d 
) [override, virtual]

Definition at line 120 of file openglsdl-graphics.cpp.

bool OpenGLSdlGraphicsManager::shouldRenderToFramebuffer (  )  const [protected]

Definition at line 467 of file openglsdl-graphics.cpp.

void OpenGLSdlGraphicsManager::showOverlay (  )  [override, virtual]

Definition at line 598 of file openglsdl-graphics.cpp.

void OpenGLSdlGraphicsManager::suggestSideTextures ( Graphics::Surface left,
Graphics::Surface right 
) [override, virtual]

Definition at line 585 of file openglsdl-graphics.cpp.

void OpenGLSdlGraphicsManager::transformMouseCoordinates ( Common::Point point  )  [override, virtual]

Transforms real screen coordinates into the current active screen coordinates (may be either game screen or overlay).

Parameters:
point Mouse coordinates to transform. !! ResidualVM specific:

Implements SdlGraphicsManager.

Definition at line 691 of file openglsdl-graphics.cpp.

void OpenGLSdlGraphicsManager::updateScreen (  )  [virtual]

Definition at line 533 of file openglsdl-graphics.cpp.

void OpenGLSdlGraphicsManager::warpMouse ( int  x,
int  y 
) [override, virtual]

Definition at line 677 of file openglsdl-graphics.cpp.


Member Data Documentation

Definition at line 146 of file openglsdl-graphics.h.

Definition at line 108 of file openglsdl-graphics.h.

Definition at line 148 of file openglsdl-graphics.h.

Definition at line 149 of file openglsdl-graphics.h.

Definition at line 150 of file openglsdl-graphics.h.

Definition at line 145 of file openglsdl-graphics.h.

Definition at line 147 of file openglsdl-graphics.h.


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


Generated on Sat May 23 2020 05:01:50 for ResidualVM by doxygen 1.7.1
curved edge   curved edge