ManaPlus
Public Types | Public Member Functions | Static Public Member Functions | Data Fields | Protected Member Functions | Protected Attributes | Static Protected Attributes | Friends
Graphics Class Referenceabstract

#include <graphics.h>

Inheritance diagram for Graphics:
ImegeGraphics MobileOpenGL2Graphics MobileOpenGLGraphics ModernOpenGLGraphics NormalOpenGLGraphics NullOpenGLGraphics SDLGraphics SurfaceGraphics

Public Types

enum  Alignment { LEFT = 0 , CENTER , RIGHT }
 

Public Member Functions

virtual ~Graphics ()
 
void setWindow (SDL_Surface *const window, const int width, const int height)
 
SDL_Surface * getWindow () const
 
void setSync (const bool sync)
 
bool getSync () const
 
virtual bool setVideoMode (const int w, const int h, const int scale, const int bpp, const bool fs, const bool hwaccel, const bool resize, const bool noFrame, const bool allowHighDPI)=0
 
bool setFullscreen (const bool fs)
 
virtual bool resizeScreen (const int width, const int height)
 
virtual void restoreContext ()
 
virtual void drawRescaledImage (const Image *const image, int dstX, int dstY, const int desiredWidth, const int desiredHeight)=0
 
virtual void drawPattern (const Image *const image, const int x, const int y, const int w, const int h)=0
 
virtual void drawRescaledPattern (const Image *const image, const int x, const int y, const int w, const int h, const int scaledWidth, const int scaledHeight)=0
 
virtual void drawImageRect (const int x, const int y, const int w, const int h, const ImageRect &imgRect)=0
 
virtual void calcPattern (ImageVertexes *const vert, const Image *const image, const int x, const int y, const int w, const int h) const =0
 
virtual void calcPattern (ImageCollection *const vert, const Image *const image, const int x, const int y, const int w, const int h) const =0
 
virtual void calcTileVertexes (ImageVertexes *const vert, const Image *const image, int x, int y) const =0
 
virtual void calcTileSDL (ImageVertexes *const vert, int x, int y) const
 
virtual void drawTileVertexes (const ImageVertexes *const vert)=0
 
virtual void drawTileCollection (const ImageCollection *const vertCol)=0
 
virtual void calcTileCollection (ImageCollection *const vertCol, const Image *const image, int x, int y)=0
 
virtual void calcWindow (ImageCollection *const vertCol, const int x, const int y, const int w, const int h, const ImageRect &imgRect)=0
 
virtual void fillRectangle (const Rect &rectangle)=0
 
virtual void updateScreen ()=0
 
void setWindowSize (const int width, const int height)
 
int getWidth () const
 
int getHeight () const
 
int getMemoryUsage () const
 
virtual void drawNet (const int x1, const int y1, const int x2, const int y2, const int width, const int height)
 
ClipRectgetTopClip () const
 
void setRedraw (const bool n)
 
bool getRedraw () const
 
void setSecure (const bool n)
 
bool getSecure () const
 
int getBpp () const
 
bool getFullScreen () const
 
bool getHWAccel () const
 
bool getDoubleBuffer () const
 
RenderType getOpenGL () const
 
void setNoFrame (const bool n)
 
const std::string & getName () const
 
virtual void initArrays (const int vertCount)
 
virtual void setColor (const Color &color)
 
const ColorgetColor () const
 
virtual void drawImage (const Image *const image, int dstX, int dstY)=0
 
virtual void copyImage (const Image *const image, int dstX, int dstY)=0
 
virtual void drawImageCached (const Image *const image, int srcX, int srcY)=0
 
virtual void drawPatternCached (const Image *const image, const int x, const int y, const int w, const int h)=0
 
virtual void completeCache ()=0
 
int getScale () const
 
virtual bool isAllowScale () const
 
void setScale (int scale)
 
virtual void pushClipArea (const Rect &area)
 
virtual void popClipArea ()
 
virtual void drawLine (int x1, int y1, int x2, int y2)=0
 
virtual void drawRectangle (const Rect &rectangle)=0
 
virtual void createGLContext (const bool custom)
 
virtual void drawPoint (int x, int y)=0
 
virtual void beginDraw ()
 
virtual void endDraw ()
 
virtual void clearScreen () const
 
virtual void deleteArrays ()
 
virtual void postInit ()
 
virtual void finalize (ImageCollection *const col)
 
virtual void finalize (ImageVertexes *const vert)
 
virtual void testDraw ()
 
virtual void removeArray (const uint32_t sz, uint32_t *const arr)
 
virtual void screenResized ()
 

Static Public Member Functions

static void cleanUp ()
 

Data Fields

int mWidth
 
int mHeight
 
int mActualWidth
 
int mActualHeight
 

Protected Member Functions

 Graphics ()
 
void setMainFlags (const int w, const int h, const int scale, const int bpp, const bool fs, const bool hwaccel, const bool resize, const bool noFrame, const bool allowHighDPI)
 
int getOpenGLFlags () const
 
int getSoftwareFlags () const
 
bool setOpenGLMode ()
 
void updateMemoryInfo ()
 
bool videoInfo ()
 
void setOpenGLFlags ()
 

Protected Attributes

MStack< ClipRectmClipStack
 
SDL_Surface * mWindow
 
int mBpp
 
bool mAlpha
 
bool mFullscreen
 
bool mHWAccel
 
bool mRedraw
 
bool mDoubleBuffer
 
SDL_Rect mRect
 
bool mSecure
 
RenderType mOpenGL
 
bool mEnableResize
 
bool mNoFrame
 
bool mAllowHighDPI
 
std::string mName
 
int mStartFreeMem
 
bool mSync
 
int mScale
 
Color mColor
 

Static Protected Attributes

static void * mGLContext = 0
 

Friends

class OpenGLScreenshotHelper
 
class SdlScreenshotHelper
 

Detailed Description

A central point of control for graphics.

Definition at line 108 of file graphics.h.

Member Enumeration Documentation

◆ Alignment

Alignments for text drawing.

Enumerator
LEFT 
CENTER 
RIGHT 

Definition at line 129 of file graphics.h.

130  {
131  LEFT = 0,
132  CENTER,
133  RIGHT
134  };
@ CENTER
Definition: graphics.h:132

Constructor & Destructor Documentation

◆ ~Graphics()

Graphics::~Graphics ( )
virtual

Destructor.

Definition at line 154 of file graphics.cpp.

155 {
156  endDraw();
157 }
virtual void endDraw()
Definition: graphics.h:453

References endDraw().

◆ Graphics()

Graphics::Graphics ( )
protected

Constructor.

Definition at line 123 of file graphics.cpp.

123  :
124  mWidth(0),
125  mHeight(0),
126  mActualWidth(0),
127  mActualHeight(0),
128  mClipStack(1000),
129  mWindow(nullptr),
130  mBpp(0),
131  mAlpha(false),
132  mFullscreen(false),
133  mHWAccel(false),
134  mRedraw(false),
135  mDoubleBuffer(false),
136  mRect(),
137  mSecure(false),
139  mEnableResize(false),
140  mNoFrame(false),
141  mAllowHighDPI(false),
142  mName("Unknown"),
143  mStartFreeMem(0),
144  mSync(false),
145  mScale(1),
146  mColor()
147 {
148  mRect.x = 0;
149  mRect.y = 0;
150  mRect.w = 0;
151  mRect.h = 0;
152 }
int mWidth
Definition: graphics.h:484
SDL_Rect mRect
Definition: graphics.h:543
bool mSecure
Definition: graphics.h:544
bool mNoFrame
Definition: graphics.h:547
SDL_Surface * mWindow
Definition: graphics.h:523
bool mHWAccel
Definition: graphics.h:540
Color mColor
Definition: graphics.h:553
int mStartFreeMem
Definition: graphics.h:550
int mHeight
Definition: graphics.h:485
int mActualHeight
Definition: graphics.h:487
bool mEnableResize
Definition: graphics.h:546
int mBpp
Definition: graphics.h:537
MStack< ClipRect > mClipStack
Definition: graphics.h:521
bool mAlpha
Definition: graphics.h:538
int mScale
Definition: graphics.h:552
bool mSync
Definition: graphics.h:551
RenderType mOpenGL
Definition: graphics.h:545
bool mAllowHighDPI
Definition: graphics.h:548
bool mRedraw
Definition: graphics.h:541
bool mFullscreen
Definition: graphics.h:539
int mActualWidth
Definition: graphics.h:486
bool mDoubleBuffer
Definition: graphics.h:542
std::string mName
Definition: graphics.h:549
@ RENDER_SOFTWARE
Definition: rendertype.h:27

References mRect.

Member Function Documentation

◆ beginDraw()

virtual void Graphics::beginDraw ( )
inlinevirtual

Initializes drawing. Called by the Gui when Gui::draw() is called. It is needed by some implementations of Graphics to perform preparations before drawing. An example of such an implementation is the OpenGLGraphics.

NOTE: You will never need to call this function yourself, unless you use a Graphics object outside of Guichan.

See also
endDraw, Gui::draw

Reimplemented in SurfaceGraphics, and ImegeGraphics.

Definition at line 441 of file graphics.h.

442  { }

Referenced by Client::initGraphics().

◆ calcPattern() [1/2]

virtual void Graphics::calcPattern ( ImageCollection *const  vert,
const Image *const  image,
const int  x,
const int  y,
const int  w,
const int  h 
) const
pure virtual

Implemented in SurfaceGraphics, and ImegeGraphics.

◆ calcPattern() [2/2]

virtual void Graphics::calcPattern ( ImageVertexes *const  vert,
const Image *const  image,
const int  x,
const int  y,
const int  w,
const int  h 
) const
pure virtual

◆ calcTileCollection()

virtual void Graphics::calcTileCollection ( ImageCollection *const  vertCol,
const Image *const  image,
int  x,
int  y 
)
pure virtual

◆ calcTileSDL()

virtual void Graphics::calcTileSDL ( ImageVertexes *const  vert,
int  x,
int  y 
) const
inlinevirtual

Reimplemented in SurfaceGraphics, and ImegeGraphics.

Definition at line 224 of file graphics.h.

227  {
228  }

◆ calcTileVertexes()

virtual void Graphics::calcTileVertexes ( ImageVertexes *const  vert,
const Image *const  image,
int  x,
int  y 
) const
pure virtual

◆ calcWindow()

virtual void Graphics::calcWindow ( ImageCollection *const  vertCol,
const int  x,
const int  y,
const int  w,
const int  h,
const ImageRect imgRect 
)
pure virtual

◆ cleanUp()

void Graphics::cleanUp ( )
static

Definition at line 159 of file graphics.cpp.

160 {
161 #ifdef USE_SDL2
162  if (mRenderer)
163  {
164  SDL_DestroyRenderer(mRenderer);
165  mRenderer = nullptr;
166  }
167 #ifdef USE_OPENGL
168  if (mGLContext)
169  {
170  SDL_GL_DeleteContext(mGLContext);
171  mGLContext = nullptr;
172  }
173 #endif // USE_OPENGL
174 #endif // USE_SDL2
175 }
static void * mGLContext
Definition: graphics.h:533

References mGLContext.

Referenced by Client::gameClear().

◆ clearScreen()

virtual void Graphics::clearScreen ( ) const
inlinevirtual

Definition at line 456 of file graphics.h.

457  { }

Referenced by Map::draw(), and TestLauncher::testTextures().

◆ completeCache()

virtual void Graphics::completeCache ( )
pure virtual

Implemented in SurfaceGraphics, and ImegeGraphics.

◆ copyImage()

virtual void Graphics::copyImage ( const Image *const  image,
int  dstX,
int  dstY 
)
pure virtual

Implemented in SurfaceGraphics, and ImegeGraphics.

◆ createGLContext()

void Graphics::createGLContext ( const bool  custom)
virtual

Reimplemented in ModernOpenGLGraphics, and MobileOpenGL2Graphics.

Definition at line 418 of file graphics.cpp.

419 {
420 #ifdef USE_SDL2
421  mGLContext = SDL_GL_CreateContext(mWindow);
422 #endif // USE_SDL2
423 }

Referenced by MobileOpenGL2Graphics::createGLContext(), ModernOpenGLGraphics::createGLContext(), GraphicsManager::detectGraphics(), and setOpenGLMode().

◆ deleteArrays()

virtual void Graphics::deleteArrays ( )
inlinevirtual

Definition at line 459 of file graphics.h.

460  { }

◆ drawImage()

virtual void Graphics::drawImage ( const Image *const  image,
int  dstX,
int  dstY 
)
pure virtual

◆ drawImageCached()

virtual void Graphics::drawImageCached ( const Image *const  image,
int  srcX,
int  srcY 
)
pure virtual

Implemented in SurfaceGraphics, and ImegeGraphics.

◆ drawImageRect()

virtual void Graphics::drawImageRect ( const int  x,
const int  y,
const int  w,
const int  h,
const ImageRect imgRect 
)
pure virtual

◆ drawLine()

virtual void Graphics::drawLine ( int  x1,
int  y1,
int  x2,
int  y2 
)
pure virtual

Ddraws a line.

Parameters
x1The first x coordinate.
y1The first y coordinate.
x2The second x coordinate.
y2The second y coordinate.

Implemented in SurfaceGraphics, and ImegeGraphics.

Referenced by BrowserBox::draw(), DropDown::draw(), StaticBrowserBox::draw(), AvatarListBox::draw(), TextBox::drawCaret(), TextField::drawCaret(), AvatarListBox::safeDraw(), and TestLauncher::testDraw().

◆ drawNet()

void Graphics::drawNet ( const int  x1,
const int  y1,
const int  x2,
const int  y2,
const int  width,
const int  height 
)
virtual

Reimplemented in SurfaceGraphics, and ImegeGraphics.

Definition at line 653 of file graphics.cpp.

656 {
657  for (int y = y1; y < y2; y += height)
658  drawLine(x1, y, x2, y);
659 
660  for (int x = x1; x < x2; x += width)
661  drawLine(x, y1, x, y2);
662 }
virtual void drawLine(int x1, int y1, int x2, int y2)=0

References drawLine(), x, and y.

Referenced by TestLauncher::testDraw().

◆ drawPattern()

virtual void Graphics::drawPattern ( const Image *const  image,
const int  x,
const int  y,
const int  w,
const int  h 
)
pure virtual

◆ drawPatternCached()

virtual void Graphics::drawPatternCached ( const Image *const  image,
const int  x,
const int  y,
const int  w,
const int  h 
)
pure virtual

Implemented in SurfaceGraphics, and ImegeGraphics.

◆ drawPoint()

virtual void Graphics::drawPoint ( int  x,
int  y 
)
pure virtual

Draws a single point/pixel.

Parameters
xThe x coordinate.
yThe y coordinate.

Implemented in SurfaceGraphics, and ImegeGraphics.

Referenced by TestLauncher::testDraw().

◆ drawRectangle()

virtual void Graphics::drawRectangle ( const Rect rectangle)
pure virtual

Draws a simple, non-filled, rectangle with a one pixel width.

Parameters
rectangleThe rectangle to draw.

Implemented in SurfaceGraphics, and ImegeGraphics.

Referenced by DropDown::draw(), SpellShortcutContainer::draw(), OutfitWindow::draw(), CastingEffect::draw(), MapItem::draw(), Minimap::draw2(), SpellShortcutContainer::safeDraw(), OutfitWindow::safeDraw(), and TestLauncher::testDraw().

◆ drawRescaledImage()

virtual void Graphics::drawRescaledImage ( const Image *const  image,
int  dstX,
int  dstY,
const int  desiredWidth,
const int  desiredHeight 
)
pure virtual

Draws a resclaled version of the image

Implemented in SurfaceGraphics, and ImegeGraphics.

Referenced by Desktop::draw(), and TestLauncher::testDraw().

◆ drawRescaledPattern()

virtual void Graphics::drawRescaledPattern ( const Image *const  image,
const int  x,
const int  y,
const int  w,
const int  h,
const int  scaledWidth,
const int  scaledHeight 
)
pure virtual

Draw a pattern based on a rescaled version of the given image...

Implemented in SurfaceGraphics, and ImegeGraphics.

Referenced by AmbientLayer::draw(), and TestLauncher::testDraw().

◆ drawTileCollection()

virtual void Graphics::drawTileCollection ( const ImageCollection *const  vertCol)
pure virtual

◆ drawTileVertexes()

virtual void Graphics::drawTileVertexes ( const ImageVertexes *const  vert)
pure virtual

◆ endDraw()

virtual void Graphics::endDraw ( )
inlinevirtual

Deinitializes drawing. Called by the Gui when a Gui::draw() is done. done. It should reset any state changes made by beginDraw().

NOTE: You will never need to call this function yourself, unless you use a Graphics object outside of Guichan.

See also
beginDraw, Gui::draw

Reimplemented in SurfaceGraphics, and ImegeGraphics.

Definition at line 453 of file graphics.h.

454  { }

Referenced by ~Graphics().

◆ fillRectangle()

virtual void Graphics::fillRectangle ( const Rect rectangle)
pure virtual

◆ finalize() [1/2]

virtual void Graphics::finalize ( ImageCollection *const  col)
inlinevirtual

◆ finalize() [2/2]

virtual void Graphics::finalize ( ImageVertexes *const  vert)
inlinevirtual

Reimplemented in ModernOpenGLGraphics, and MobileOpenGL2Graphics.

Definition at line 469 of file graphics.h.

471  { }

◆ getBpp()

int Graphics::getBpp ( ) const
inline

Definition at line 296 of file graphics.h.

297  { return mBpp; }

References mBpp.

◆ getColor()

const Color& Graphics::getColor ( ) const
inline

Definition at line 326 of file graphics.h.

327  { return mColor; }

References mColor.

◆ getDoubleBuffer()

bool Graphics::getDoubleBuffer ( ) const
inline

Definition at line 305 of file graphics.h.

306  { return mDoubleBuffer; }

References mDoubleBuffer.

◆ getFullScreen()

bool Graphics::getFullScreen ( ) const
inline

Definition at line 299 of file graphics.h.

300  { return mFullscreen; }

References mFullscreen.

◆ getHeight()

int Graphics::getHeight ( ) const

Returns the height of the screen.

Definition at line 648 of file graphics.cpp.

649 {
650  return mHeight;
651 }

References mHeight.

Referenced by ChatWindow::ChatWindow(), Minimap::draw2(), CharCreateDialog::setButtonsPosition(), setConfigDefaults2(), PopupMenu::showPopup(), Client::stateGame(), and Client::stateGame1().

◆ getHWAccel()

bool Graphics::getHWAccel ( ) const
inline

Definition at line 302 of file graphics.h.

303  { return mHWAccel; }

References mHWAccel.

◆ getMemoryUsage()

int Graphics::getMemoryUsage ( ) const

Definition at line 441 of file graphics.cpp.

442 {
443 #ifdef USE_OPENGL
444  if (mStartFreeMem == 0)
445  return 0;
446 
447  if (graphicsManager.supportExtension("GL_NVX_gpu_memory_info"))
448  {
449  GLint val;
451  &val);
452  return mStartFreeMem - val;
453  }
454 #endif // USE_OPENGL
455  return 0;
456 }
bool supportExtension(const std::string &ext) const
#define GPU_MEMORY_INFO_CURRENT_AVAILABLE_VIDMEM_NVX
Definition: graphics.cpp:105
GraphicsManager graphicsManager

References GPU_MEMORY_INFO_CURRENT_AVAILABLE_VIDMEM_NVX, graphicsManager, mStartFreeMem, and GraphicsManager::supportExtension().

◆ getName()

const std::string& Graphics::getName ( ) const
inline

Definition at line 314 of file graphics.h.

315  { return mName; }

References mName.

Referenced by UserAgent::update().

◆ getOpenGL()

RenderType Graphics::getOpenGL ( ) const
inline

Definition at line 308 of file graphics.h.

309  { return mOpenGL; }

References mOpenGL.

Referenced by Game::Game(), setOpenGLMode(), and Game::slowLogic().

◆ getOpenGLFlags()

int Graphics::getOpenGLFlags ( ) const
protected

< Allow any video depth/pixel-format

< Create an OpenGL rendering context

< Surface is a full screen display

< This video mode may be resized

< No window caption or edge frame

Definition at line 242 of file graphics.cpp.

243 {
244 #ifdef USE_OPENGL
245 
246 #ifdef USE_SDL2
247  int displayFlags = SDL_WINDOW_OPENGL;
248  if (mFullscreen)
249  displayFlags |= SDL_WINDOW_FULLSCREEN;
250 #if SDL_VERSION_ATLEAST(2, 0, 1)
251  if (mAllowHighDPI)
252  displayFlags |= SDL_WINDOW_ALLOW_HIGHDPI;
253 #endif // SDL_VERSION_ATLEAST(2, 0, 1)
254 #else // USE_SDL2
255 
256  int displayFlags = SDL_ANYFORMAT | SDL_OPENGL;
257 #endif // USE_SDL2
258 
259  if (mFullscreen)
260  {
261  displayFlags |= SDL_FULLSCREEN;
262  }
263  else
264  {
265  // Resizing currently not supported on Windows, where it would require
266  // reuploading all textures.
267 #if !defined(_WIN32)
268  if (mEnableResize)
269  displayFlags |= SDL_RESIZABLE;
270 #endif // !defined(_WIN32)
271  }
272 
273  if (mNoFrame)
274  displayFlags |= SDL_NOFRAME;
275 
276  return displayFlags;
277 #else // USE_OPENGL
278 
279  return 0;
280 #endif // USE_OPENGL
281 }

References mAllowHighDPI, mEnableResize, mFullscreen, and mNoFrame.

Referenced by setOpenGLMode().

◆ getRedraw()

bool Graphics::getRedraw ( ) const
inline

◆ getScale()

int Graphics::getScale ( ) const
inline

Definition at line 366 of file graphics.h.

367  { return mScale; }

References mScale.

Referenced by WindowManager::applyScale(), Gui::getMouseState(), and SDLInput::pushInput().

◆ getSecure()

bool Graphics::getSecure ( ) const
inline

Definition at line 293 of file graphics.h.

294  { return mSecure; }

References mSecure.

Referenced by AvatarListBox::draw(), and AvatarListBox::safeDraw().

◆ getSoftwareFlags()

int Graphics::getSoftwareFlags ( ) const
protected

< Allow any video depth/pixel-format

< Surface is in video memory

< Set up double-buffered video mode

< Surface is in system memory

< Surface is a full screen display

< This video mode may be resized

< No window caption or edge frame

Definition at line 389 of file graphics.cpp.

390 {
391 #ifdef USE_SDL2
392  int displayFlags = SDL_WINDOW_SHOWN;
393 #if SDL_VERSION_ATLEAST(2, 0, 1)
394  if (mAllowHighDPI)
395  displayFlags |= SDL_WINDOW_ALLOW_HIGHDPI;
396 #endif // SDL_VERSION_ATLEAST(2, 0, 1)
397 #else // USE_SDL2
398 
399  int displayFlags = SDL_ANYFORMAT;
400 
401  if (mHWAccel)
402  displayFlags |= SDL_HWSURFACE | SDL_DOUBLEBUF;
403  else
404  displayFlags |= SDL_SWSURFACE;
405 #endif // USE_SDL2
406 
407  if (mFullscreen)
408  displayFlags |= SDL_FULLSCREEN;
409  else if (mEnableResize)
410  displayFlags |= SDL_RESIZABLE;
411 
412  if (mNoFrame)
413  displayFlags |= SDL_NOFRAME;
414  return displayFlags;
415 }

References mAllowHighDPI, mEnableResize, mFullscreen, mHWAccel, and mNoFrame.

◆ getSync()

bool Graphics::getSync ( ) const
inline

Definition at line 153 of file graphics.h.

154  { return mSync; }

References mSync.

◆ getTopClip()

ClipRect& Graphics::getTopClip ( ) const
inline

Definition at line 281 of file graphics.h.

282  { return mClipStack.top(); }
T & top() const
Definition: mstack.h:73

References mClipStack, and MStack< T >::top().

Referenced by BrowserBox::draw(), Button::draw(), StaticBrowserBox::draw(), TextField::drawCaret(), and ScrollArea::updateCalcFlag().

◆ getWidth()

int Graphics::getWidth ( ) const

Returns the width of the screen.

Definition at line 643 of file graphics.cpp.

644 {
645  return mWidth;
646 }

References mWidth.

Referenced by CharacterDisplay::CharacterDisplay(), CharSelectDialog::CharSelectDialog(), ChatWindow::ChatWindow(), Minimap::draw2(), Client::stateGame(), and Client::stateGame1().

◆ getWindow()

SDL_Surface* Graphics::getWindow ( ) const
inline

◆ initArrays()

virtual void Graphics::initArrays ( const int  vertCount)
inlinevirtual

Definition at line 317 of file graphics.h.

318  { }

Referenced by setOpenGLMode().

◆ isAllowScale()

virtual bool Graphics::isAllowScale ( ) const
inlinevirtual

Definition at line 369 of file graphics.h.

370  { return false; }

◆ popClipArea()

void Graphics::popClipArea ( )
virtual

Removes the top most clip area from the stack.

Exceptions
Exceptionif the stack is empty.

Reimplemented in SurfaceGraphics, and ImegeGraphics.

Definition at line 739 of file graphics.cpp.

740 {
741  if (mClipStack.empty())
742  return;
743 
744  mClipStack.pop();
745 }
bool empty() const
Definition: mstack.h:88
void pop()
Definition: mstack.h:68

References MStack< T >::empty(), mClipStack, and MStack< T >::pop().

Referenced by Gui::draw(), GuiTable::draw(), Minimap::draw2(), GuiTable::safeDraw(), and TestLauncher::testDraw().

◆ postInit()

virtual void Graphics::postInit ( )
inlinevirtual

Reimplemented in ModernOpenGLGraphics, MobileOpenGLGraphics, and MobileOpenGL2Graphics.

Definition at line 462 of file graphics.h.

463  { }

Referenced by Client::gameInit().

◆ pushClipArea()

void Graphics::pushClipArea ( const Rect area)
virtual

Pushes a clip area onto the stack. The x and y coordinates in the rectangle is relative to the last pushed clip area. If the new area falls outside the current clip area, it will be clipped as necessary.

If a clip area is outside of the top clip area a clip area with zero width and height will be pushed.

Parameters
areaThe clip area to be pushed onto the stack.

Reimplemented in SurfaceGraphics, and ImegeGraphics.

Definition at line 677 of file graphics.cpp.

678 {
679  // Ignore area with a negate width or height
680  // by simple pushing an empty clip area
681  // to the stack.
682  if (area.width < 0 || area.height < 0)
683  {
684  ClipRect &carea = mClipStack.push();
685  carea.x = 0;
686  carea.y = 0;
687  carea.width = 0;
688  carea.height = 0;
689  carea.xOffset = 0;
690  carea.yOffset = 0;
691  return;
692  }
693 
694  if (mClipStack.empty())
695  {
696  ClipRect &carea = mClipStack.push();
697  carea.x = area.x;
698  carea.y = area.y;
699  carea.width = area.width;
700  carea.height = area.height;
701  carea.xOffset = area.x;
702  carea.yOffset = area.y;
703  return;
704  }
705 
706  const ClipRect &top = mClipStack.top();
707  ClipRect &carea = mClipStack.push();
708  carea.x = area.x + top.xOffset;
709  carea.y = area.y + top.yOffset;
710  carea.width = area.width;
711  carea.height = area.height;
712  carea.xOffset = top.xOffset + area.x;
713  carea.yOffset = top.yOffset + area.y;
714 
715  // Clamp the pushed clip rectangle.
716  if (carea.x < top.x)
717  carea.x = top.x;
718 
719  if (carea.y < top.y)
720  carea.y = top.y;
721 
722  if (carea.x + carea.width > top.x + top.width)
723  {
724  carea.width = top.x + top.width - carea.x;
725 
726  if (carea.width < 0)
727  carea.width = 0;
728  }
729 
730  if (carea.y + carea.height > top.y + top.height)
731  {
732  carea.height = top.y + top.height - carea.y;
733 
734  if (carea.height < 0)
735  carea.height = 0;
736  }
737 }
int yOffset
Definition: cliprect.h:127
int xOffset
Definition: cliprect.h:122
int y
Definition: rect.h:214
int width
Definition: rect.h:219
int x
Definition: rect.h:209
int height
Definition: rect.h:224
const Image *restrict const top
T & push()
Definition: mstack.h:48

References Rect::height, top, Rect::width, Rect::x, ClipRect::xOffset, Rect::y, and ClipRect::yOffset.

Referenced by Gui::draw(), GuiTable::draw(), Minimap::draw2(), GuiTable::safeDraw(), and TestLauncher::testDraw().

◆ removeArray()

virtual void Graphics::removeArray ( const uint32_t  sz,
uint32_t *const  arr 
)
inlinevirtual

Reimplemented in ModernOpenGLGraphics, and MobileOpenGL2Graphics.

Definition at line 476 of file graphics.h.

479  { }

◆ resizeScreen()

bool Graphics::resizeScreen ( const int  width,
const int  height 
)
virtual

Resize the window to the specified size.

Definition at line 558 of file graphics.cpp.

560 {
561 #ifdef USE_SDL2
562  endDraw();
563 
564  mRect.w = CAST_S32(width / mScale);
565  mRect.h = CAST_S32(height / mScale);
566  mWidth = width / mScale;
567  mHeight = height / mScale;
568  mActualWidth = width;
569  mActualHeight = height;
570 
571 #ifdef USE_OPENGL
572  // +++ probably this way will not work in windows/mac
573  // Setup OpenGL
574  glViewport(0, 0, mActualWidth, mActualHeight);
575  glHint(GL_PERSPECTIVE_CORRECTION_HINT, GL_FASTEST);
576 #else // USE_OPENGL
577  // +++ need impliment resize in soft mode
578 #endif // USE_OPENGL
579 
580  screenResized();
581  beginDraw();
582  return true;
583 
584 #else // USE_SDL2
585 
586  const int prevWidth = mWidth;
587  const int prevHeight = mHeight;
588 
589  endDraw();
590 
591  bool success = true;
592 #ifdef __native_client__
593  if (mOpenGL != RENDER_SOFTWARE)
594  {
595  mRect.w = CAST_S32(width / mScale);
596  mRect.h = CAST_S32(height / mScale);
597  mWidth = width / mScale;
598  mHeight = height / mScale;
599  mActualWidth = width;
600  mActualHeight = height;
601 #ifdef USE_OPENGL
602  naclResizeBuffers(mActualWidth, mActualHeight);
603  glViewport(0, 0, mActualWidth, mActualHeight);
604 #endif // USE_OPENGL
605  }
606  else
607 #endif // __native_client__
608  {
609  success = setVideoMode(width, height,
610  mScale,
611  mBpp,
612  mFullscreen,
613  mHWAccel,
615  mNoFrame,
616  mAllowHighDPI);
617 
618  // If it didn't work, try to restore the previous size. If that didn't
619  // work either, bail out (but then we're in deep trouble).
620  if (!success)
621  {
622  if (!setVideoMode(prevWidth, prevHeight,
623  mScale,
624  mBpp,
625  mFullscreen,
626  mHWAccel,
628  mNoFrame,
629  mAllowHighDPI))
630  {
631  return false;
632  }
633  }
634  }
635 
636  screenResized();
637  beginDraw();
638 
639  return success;
640 #endif // USE_SDL2
641 }
#define CAST_S32
Definition: cast.h:30
virtual void beginDraw()
Definition: graphics.h:441
virtual bool setVideoMode(const int w, const int h, const int scale, const int bpp, const bool fs, const bool hwaccel, const bool resize, const bool noFrame, const bool allowHighDPI)=0
virtual void screenResized()
Definition: graphics.h:481

References beginDraw(), CAST_S32, endDraw(), RENDER_SOFTWARE, and setVideoMode().

Referenced by WindowManager::resizeVideo().

◆ restoreContext()

virtual void Graphics::restoreContext ( )
inlinevirtual

Definition at line 179 of file graphics.h.

180  { }

◆ screenResized()

virtual void Graphics::screenResized ( )
inlinevirtual

Reimplemented in ModernOpenGLGraphics, and MobileOpenGL2Graphics.

Definition at line 481 of file graphics.h.

482  { }

◆ setColor()

virtual void Graphics::setColor ( const Color color)
inlinevirtual

◆ setFullscreen()

bool Graphics::setFullscreen ( const bool  fs)

Set fullscreen mode.

Definition at line 542 of file graphics.cpp.

543 {
544  if (mFullscreen == fs)
545  return true;
546 
547  return setVideoMode(mActualWidth,
549  mScale,
550  mBpp,
551  fs,
552  mHWAccel,
554  mNoFrame,
555  mAllowHighDPI);
556 }

References setVideoMode().

Referenced by WindowManager::setFullScreen().

◆ setMainFlags()

void Graphics::setMainFlags ( const int  w,
const int  h,
const int  scale,
const int  bpp,
const bool  fs,
const bool  hwaccel,
const bool  resize,
const bool  noFrame,
const bool  allowHighDPI 
)
protected

Definition at line 182 of file graphics.cpp.

190 {
191  logger->log("graphics backend: %s", getName().c_str());
192  logger->log("Setting video mode %dx%d %s",
193  w, h, fs ? "fullscreen" : "windowed");
194 
195  mBpp = bpp;
196  mFullscreen = fs;
197  mHWAccel = hwaccel;
198  mEnableResize = resize;
199  mNoFrame = noFrame;
200  mAllowHighDPI = allowHighDPI;
201  mActualWidth = w;
202  mActualHeight = h;
203  setScale(scale);
204 }
const std::string & getName() const
Definition: graphics.h:314
void setScale(int scale)
Definition: graphics.cpp:206
void log(const char *const log_text,...)
Definition: logger.cpp:269
Logger * logger
Definition: logger.cpp:89

References GroupDb::getName(), Logger::log(), and logger.

◆ setNoFrame()

void Graphics::setNoFrame ( const bool  n)
inline

Definition at line 311 of file graphics.h.

312  { mNoFrame = n; }

References mNoFrame.

◆ setOpenGLFlags()

void Graphics::setOpenGLFlags ( )
protected

Definition at line 748 of file graphics.cpp.

749 {
750  // here disable/enable probably need convert to mgl
751 
752  glEnable(GL_SCISSOR_TEST);
753 
754  glDisable(GL_MULTISAMPLE);
755  glDisable(GL_DITHER);
756  glDisable(GL_DEPTH_TEST);
757  glDisable(GL_LINE_SMOOTH);
758  glDisable(GL_POLYGON_SMOOTH);
759  glDisable(GL_STENCIL_TEST);
760  glDisable(GL_COLOR_LOGIC_OP);
761  glDisable(GL_DEPTH_BOUNDS_TEST_EXT);
762  glDisable(GL_DEPTH_CLAMP);
763  glDisable(GL_RASTERIZER_DISCARD);
764  glDisable(GL_SAMPLE_MASK);
765 
766 #ifndef ANDROID
767 #ifndef __MINGW32__
768  glHint(GL_TEXTURE_COMPRESSION_HINT, GL_FASTEST);
769 #endif // __MINGW32__
770 #endif // ANDROID
771 
772  glHint(GL_TEXTURE_COMPRESSION_HINT_ARB, GL_FASTEST);
773 
774  glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
775 }
#define GL_POLYGON_SMOOTH
Definition: mgldefines.h:110
#define GL_RASTERIZER_DISCARD
Definition: mgldefines.h:105
#define GL_SAMPLE_MASK
Definition: mgldefines.h:106
#define GL_TEXTURE_COMPRESSION_HINT_ARB
Definition: mgldefines.h:118
#define GL_DEPTH_CLAMP
Definition: mgldefines.h:104
#define GL_DEPTH_BOUNDS_TEST_EXT
Definition: mgldefines.h:114

References GL_DEPTH_BOUNDS_TEST_EXT, GL_DEPTH_CLAMP, GL_POLYGON_SMOOTH, GL_RASTERIZER_DISCARD, GL_SAMPLE_MASK, and GL_TEXTURE_COMPRESSION_HINT_ARB.

◆ setOpenGLMode()

bool Graphics::setOpenGLMode ( )
protected

Definition at line 283 of file graphics.cpp.

284 {
285 #ifdef USE_OPENGL
286  SDL_GL_SetAttribute(SDL_GL_DOUBLEBUFFER, 1);
289  mBpp, getOpenGLFlags())) == nullptr)
290  {
291  logger->log("Window/context creation failed");
292  mRect.w = 0;
293  mRect.h = 0;
294  return false;
295  }
296 
297 #if defined(USE_X11)
298  Glx::initFunctions();
299 #endif // defined(USE_X11)
300 #ifdef __native_client__
301  NaclGles::initGles();
302 #endif // __native_client__
303 
304 #ifdef USE_SDL2
305  int w1 = 0;
306  int h1 = 0;
307  SDL_GetWindowSize(mWindow, &w1, &h1);
308  mRect.w = CAST_S32(w1 / mScale);
309  mRect.h = CAST_S32(h1 / mScale);
310 
311  createGLContext(config.getBoolValue("openglContext"));
312 #else // USE_SDL2
313 
314  createGLContext(config.getBoolValue("openglContext"));
315  mRect.w = CAST_U16(mWindow->w / mScale);
316  mRect.h = CAST_U16(mWindow->h / mScale);
317 
318 #endif // USE_SDL2
319 
320 #ifdef __APPLE__
321  if (mSync)
322  {
323  const GLint VBL = 1;
324  CGLSetParameter(CGLGetCurrentContext(), kCGLCPSwapInterval, &VBL);
325  }
326 #endif // __APPLE__
327 
330 
331  // Setup OpenGL
332  glViewport(0, 0, mActualWidth, mActualHeight);
333  int gotDoubleBuffer = 0;
334  SDL_GL_GetAttribute(SDL_GL_DOUBLEBUFFER, &gotDoubleBuffer);
335  logger->log("Using OpenGL %s double buffering.",
336  (gotDoubleBuffer != 0 ? "with" : "without"));
337 
343 
344  GLint texSize;
345  bool rectTex = graphicsManager.supportExtension(
346  "GL_ARB_texture_rectangle") ||
347  graphicsManager.supportExtension("GL_EXT_texture_rectangle");
348 
349  if (rectTex
354  && config.getBoolValue("rectangulartextures")
356  {
357  logger->log1("using GL_ARB_texture_rectangle");
359  glEnable(GL_TEXTURE_RECTANGLE_ARB);
360  glGetIntegerv(GL_MAX_RECTANGLE_TEXTURE_SIZE_ARB, &texSize);
362  logger->log("OpenGL texture size: %d pixels (rectangle textures)",
364 #if !defined(ANDROID) && !defined(__SWITCH__)
367 #endif // ANDROID
368  }
369  else
370  {
371  glGetIntegerv(GL_MAX_TEXTURE_SIZE, &texSize);
372  OpenGLImageHelper::mTextureType = GL_TEXTURE_2D;
374 #if !defined(ANDROID) && !defined(__SWITCH__)
375  SafeOpenGLImageHelper::mTextureType = GL_TEXTURE_2D;
377 #endif // ANDROID
378 
379  logger->log("OpenGL texture size: %d pixels",
381  }
382  return videoInfo();
383 #else // USE_OPENGL
384 
385  return false;
386 #endif // USE_OPENGL
387 }
#define CAST_U16
Definition: cast.h:29
bool getBoolValue(const std::string &key) const
static void updateTextureFormat()
void updateTextureCompressionFormat() const
static SDL_Surface * createWindow(const int w, const int h, const int bpp, const int flags)
void logVersion() const
bool isUseTextureSampler() const
int getMaxVertices() const
RenderType getOpenGL() const
Definition: graphics.h:308
virtual void createGLContext(const bool custom)
Definition: graphics.cpp:418
bool videoInfo()
Definition: graphics.cpp:483
virtual void initArrays(const int vertCount)
Definition: graphics.h:317
void updateMemoryInfo()
Definition: graphics.cpp:426
int getOpenGLFlags() const
Definition: graphics.cpp:242
void log1(const char *const log_text)
Definition: logger.cpp:238
static int getInternalTextureType()
Configuration config
#define GL_MAX_RECTANGLE_TEXTURE_SIZE_ARB
#define GL_TEXTURE_RECTANGLE_ARB
@ RENDER_GLES2_OPENGL
Definition: rendertype.h:33
@ RENDER_GLES_OPENGL
Definition: rendertype.h:30
@ RENDER_MODERN_OPENGL
Definition: rendertype.h:32

References CAST_S32, CAST_U16, config, createGLContext(), GraphicsManager::createWindow(), Configuration::getBoolValue(), OpenGLImageHelper::getInternalTextureType(), GraphicsManager::getMaxVertices(), getOpenGL(), getOpenGLFlags(), GL_MAX_RECTANGLE_TEXTURE_SIZE_ARB, GL_TEXTURE_RECTANGLE_ARB, graphicsManager, initArrays(), GraphicsManager::initOpenGL(), GraphicsManager::isUseTextureSampler(), Logger::log(), Logger::log1(), logger, GraphicsManager::logVersion(), mActualHeight, mActualWidth, mBpp, mRect, mScale, mSync, OpenGLImageHelper::mTextureSize, SafeOpenGLImageHelper::mTextureSize, OpenGLImageHelper::mTextureType, SafeOpenGLImageHelper::mTextureType, mWindow, RENDER_GLES2_OPENGL, RENDER_GLES_OPENGL, RENDER_MODERN_OPENGL, GraphicsManager::setGLVersion(), GraphicsManager::supportExtension(), updateMemoryInfo(), GraphicsManager::updateTextureCompressionFormat(), GraphicsManager::updateTextureFormat(), and videoInfo().

◆ setRedraw()

void Graphics::setRedraw ( const bool  n)
inline

Definition at line 284 of file graphics.h.

285  { mRedraw = n; }

References mRedraw.

Referenced by ScrollArea::draw(), and Window::draw().

◆ setScale()

void Graphics::setScale ( int  scale)

Definition at line 206 of file graphics.cpp.

207 {
208  if (isAllowScale())
209  {
210  if (scale == 0)
211  scale = 1;
212  int scaleW = mActualWidth / scale;
213  int scaleH = mActualHeight / scale;
214  if (scaleW < 470)
215  {
216  scale = mActualWidth / 470;
217  if (scale < 1)
218  scale = 1;
219  scaleH = mActualHeight / scale;
220  }
221  if (scaleH < 320)
222  {
223  scale = mActualHeight / 320;
224  if (scale < 1)
225  scale = 1;
226  }
227  logger->log("set scale: %d", scale);
228  mScale = scale;
231  }
232  else
233  {
234  mScale = 1;
237  }
238  mRect.w = static_cast<RectSize>(mWidth);
239  mRect.h = static_cast<RectSize>(mHeight);
240 }
virtual bool isAllowScale() const
Definition: graphics.h:369
#define RectSize
Definition: graphics.h:95

References isAllowScale(), Logger::log(), logger, and RectSize.

Referenced by WindowManager::applyScale().

◆ setSecure()

void Graphics::setSecure ( const bool  n)
inline

Definition at line 290 of file graphics.h.

291  { mSecure = n; }

References mSecure.

Referenced by Game::createScreenshot().

◆ setSync()

void Graphics::setSync ( const bool  sync)

Sets whether vertical refresh syncing is enabled. Takes effect after the next call to setVideoMode(). Only implemented on MacOS for now.

Definition at line 177 of file graphics.cpp.

178 {
179  mSync = sync;
180 }

References Ea::BeingRecv::mSync.

◆ setVideoMode()

virtual bool Graphics::setVideoMode ( const int  w,
const int  h,
const int  scale,
const int  bpp,
const bool  fs,
const bool  hwaccel,
const bool  resize,
const bool  noFrame,
const bool  allowHighDPI 
)
pure virtual

Try to create a window with the given settings.

Implemented in SurfaceGraphics, and ImegeGraphics.

Referenced by GraphicsManager::setVideoMode().

◆ setWindow()

void Graphics::setWindow ( SDL_Surface *const  window,
const int  width,
const int  height 
)
inline

Definition at line 136 of file graphics.h.

138  {
139  mWindow = window;
140  mRect.w = static_cast<RectSize>(width);
141  mRect.h = static_cast<RectSize>(height);
142  }

References mRect, mWindow, and RectSize.

Referenced by GraphicsManager::detectGraphics().

◆ setWindowSize()

void Graphics::setWindowSize ( const int  width,
const int  height 
)

Definition at line 671 of file graphics.cpp.

673 {
674 }

Referenced by Setup_Video::action().

◆ testDraw()

virtual void Graphics::testDraw ( )
inlinevirtual

Reimplemented in NormalOpenGLGraphics, ModernOpenGLGraphics, and MobileOpenGL2Graphics.

Definition at line 473 of file graphics.h.

474  { }

Referenced by TestLauncher::testFps2().

◆ updateMemoryInfo()

void Graphics::updateMemoryInfo ( )
protected

Definition at line 426 of file graphics.cpp.

427 {
428 #ifdef USE_OPENGL
429  if (mStartFreeMem != 0)
430  return;
431 
432  if (graphicsManager.supportExtension("GL_NVX_gpu_memory_info"))
433  {
435  &mStartFreeMem);
436  logger->log("free video memory: %d", mStartFreeMem);
437  }
438 #endif // USE_OPENGL
439 }

References GPU_MEMORY_INFO_CURRENT_AVAILABLE_VIDMEM_NVX, graphicsManager, Logger::log(), logger, mStartFreeMem, and GraphicsManager::supportExtension().

Referenced by setOpenGLMode().

◆ updateScreen()

virtual void Graphics::updateScreen ( )
pure virtual

Updates the screen. This is done by either copying the buffer to the screen or swapping pages.

Implemented in SurfaceGraphics, and ImegeGraphics.

Referenced by Client::gameExec(), PRAGMA45(), TestLauncher::testBackend(), TestLauncher::testDraw(), TestLauncher::testFps2(), TestLauncher::testFps3(), and TestLauncher::testTextures().

◆ videoInfo()

bool Graphics::videoInfo ( )
protected

< Set up double-buffered video mode

< Set up double-buffered video mode

Definition at line 483 of file graphics.cpp.

484 {
485  logger->log("SDL video info");
486 #ifdef USE_SDL2
487  logger->log("Using video driver: %s", SDL_GetCurrentVideoDriver());
488 
489  if (mRenderer)
490  {
491  SDL_RendererInfo info;
492  SDL_GetRendererInfo(mRenderer, &info);
493  dumpRendererInfo("Current SDL renderer name: %s", info);
494 
495  const int num = SDL_GetNumRenderDrivers();
496  logger->log("Known renderers");
497  for (int f = 0; f < num; f ++)
498  {
499  if (!SDL_GetRenderDriverInfo(f, &info))
500  dumpRendererInfo("renderer name: %s", info);
501  }
502  }
503 #else // USE_SDL2
504 
505  char videoDriverName[65];
506  if (SDL_VideoDriverName(videoDriverName, 64) != nullptr)
507  logger->log("Using video driver: %s", videoDriverName);
508  else
509  logger->log1("Using video driver: unknown");
510  mDoubleBuffer = ((mWindow->flags & SDL_DOUBLEBUF) == SDL_DOUBLEBUF);
511  logger->log("Double buffer mode: %s", mDoubleBuffer ? "yes" : "no");
512 
514 
515  const SDL_VideoInfo *restrict const vi = SDL_GetVideoInfo();
516  if (vi == nullptr)
517  return false;
518 
519  logger->log("Possible to create hardware surfaces: %s",
520  ((vi->hw_available) != 0U ? "yes" : "no"));
521  logger->log("Window manager available: %s",
522  ((vi->wm_available) != 0U ? "yes" : "no"));
523  logger->log("Accelerated hardware to hardware blits: %s",
524  ((vi->blit_hw) != 0U ? "yes" : "no"));
525  logger->log("Accelerated hardware to hardware colorkey blits: %s",
526  ((vi->blit_hw_CC) != 0U ? "yes" : "no"));
527  logger->log("Accelerated hardware to hardware alpha blits: %s",
528  ((vi->blit_hw_A) != 0U ? "yes" : "no"));
529  logger->log("Accelerated software to hardware blits: %s",
530  ((vi->blit_sw) != 0U ? "yes" : "no"));
531  logger->log("Accelerated software to hardware colorkey blits: %s",
532  ((vi->blit_sw_CC) != 0U ? "yes" : "no"));
533  logger->log("Accelerated software to hardware alpha blits: %s",
534  ((vi->blit_sw_A) != 0U ? "yes" : "no"));
535  logger->log("Accelerated color fills: %s",
536  ((vi->blit_fill) != 0U ? "yes" : "no"));
537 #endif // USE_SDL2
538 
539  return true;
540 }
static void dumpSurfaceFormat(const SDL_Surface *const image)
#define restrict
Definition: localconsts.h:165
bool info(InputEvent &event)
Definition: commands.cpp:57

References ImageHelper::dumpSurfaceFormat(), Actions::info(), Logger::log(), Logger::log1(), logger, mDoubleBuffer, mWindow, and restrict.

Referenced by setOpenGLMode().

Friends And Related Function Documentation

◆ OpenGLScreenshotHelper

friend class OpenGLScreenshotHelper
friend

Definition at line 112 of file graphics.h.

◆ SdlScreenshotHelper

friend class SdlScreenshotHelper
friend

Definition at line 115 of file graphics.h.

Field Documentation

◆ mActualHeight

int Graphics::mActualHeight

◆ mActualWidth

int Graphics::mActualWidth

◆ mAllowHighDPI

bool Graphics::mAllowHighDPI
protected

Definition at line 548 of file graphics.h.

Referenced by getOpenGLFlags(), and getSoftwareFlags().

◆ mAlpha

bool Graphics::mAlpha
protected

Definition at line 538 of file graphics.h.

Referenced by disableTexturingAndBlending(), enableTexturingAndBlending(), and setColor().

◆ mBpp

int Graphics::mBpp
protected

Definition at line 537 of file graphics.h.

Referenced by getBpp(), and setOpenGLMode().

◆ mClipStack

MStack<ClipRect> Graphics::mClipStack
protected

Holds the clip area stack.

Definition at line 521 of file graphics.h.

Referenced by getTopClip(), and popClipArea().

◆ mColor

Color Graphics::mColor
protected

◆ mDoubleBuffer

bool Graphics::mDoubleBuffer
protected

Definition at line 542 of file graphics.h.

Referenced by getDoubleBuffer(), and videoInfo().

◆ mEnableResize

bool Graphics::mEnableResize
protected

Definition at line 546 of file graphics.h.

Referenced by getOpenGLFlags(), and getSoftwareFlags().

◆ mFullscreen

bool Graphics::mFullscreen
protected

Definition at line 539 of file graphics.h.

Referenced by getFullScreen(), getOpenGLFlags(), and getSoftwareFlags().

◆ mGLContext

void * Graphics::mGLContext = 0
staticprotected

Definition at line 533 of file graphics.h.

Referenced by cleanUp().

◆ mHeight

int Graphics::mHeight

◆ mHWAccel

bool Graphics::mHWAccel
protected

Definition at line 540 of file graphics.h.

Referenced by getHWAccel(), and getSoftwareFlags().

◆ mName

std::string Graphics::mName
protected

◆ mNoFrame

bool Graphics::mNoFrame
protected

Definition at line 547 of file graphics.h.

Referenced by getOpenGLFlags(), getSoftwareFlags(), and setNoFrame().

◆ mOpenGL

RenderType Graphics::mOpenGL
protected

◆ mRect

SDL_Rect Graphics::mRect
protected

Definition at line 543 of file graphics.h.

Referenced by Graphics(), setOpenGLMode(), and setWindow().

◆ mRedraw

bool Graphics::mRedraw
protected

Definition at line 541 of file graphics.h.

Referenced by getRedraw(), and setRedraw().

◆ mScale

int Graphics::mScale
protected

Definition at line 552 of file graphics.h.

Referenced by getScale(), and setOpenGLMode().

◆ mSecure

bool Graphics::mSecure
protected

Definition at line 544 of file graphics.h.

Referenced by getSecure(), and setSecure().

◆ mStartFreeMem

int Graphics::mStartFreeMem
protected

Definition at line 550 of file graphics.h.

Referenced by getMemoryUsage(), and updateMemoryInfo().

◆ mSync

bool Graphics::mSync
protected

Definition at line 551 of file graphics.h.

Referenced by getSync(), and setOpenGLMode().

◆ mWidth

int Graphics::mWidth

◆ mWindow

SDL_Surface* Graphics::mWindow
protected

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