ManaPlus
safeopenglgraphics.cpp
Go to the documentation of this file.
1 /*
2  * The ManaPlus Client
3  * Copyright (C) 2004-2009 The Mana World Development Team
4  * Copyright (C) 2009-2010 The Mana Developers
5  * Copyright (C) 2011-2018 The ManaPlus Developers
6  *
7  * This file is part of The ManaPlus Client.
8  *
9  * This program is free software; you can redistribute it and/or modify
10  * it under the terms of the GNU General Public License as published by
11  * the Free Software Foundation; either version 2 of the License, or
12  * any later version.
13  *
14  * This program is distributed in the hope that it will be useful,
15  * but WITHOUT ANY WARRANTY; without even the implied warranty of
16  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17  * GNU General Public License for more details.
18  *
19  * You should have received a copy of the GNU General Public License
20  * along with this program. If not, see <http://www.gnu.org/licenses/>.
21  */
22 
23 #if defined USE_OPENGL && !defined ANDROID
25 
26 #ifdef DEBUG_OPENGL
27 #include "render/opengl/mgl.h"
28 #endif // DEBUG_OPENGL
29 
30 #include "resources/imagerect.h"
32 
33 #include "resources/image/image.h"
34 
35 #include "utils/sdlcheckutils.h"
36 
37 #include "debug.h"
38 
40 
42  mTexture(false),
43  mIsByteColor(false),
44  mByteColor(),
45  mFloatColor(1.0F),
46  mColorAlpha(false),
47  mFbo()
48 {
50  mName = "safe OpenGL";
51 }
52 
54 {
55 }
56 
58 {
59 }
60 
61 bool SafeOpenGLGraphics::setVideoMode(const int w, const int h,
62  const int scale,
63  const int bpp,
64  const bool fs,
65  const bool hwaccel,
66  const bool resize,
67  const bool noFrame,
68  const bool allowHighDPI) restrict2
69 {
70  setMainFlags(w, h,
71  scale,
72  bpp,
73  fs,
74  hwaccel,
75  resize,
76  noFrame,
77  allowHighDPI);
78 
79  return setOpenGLMode();
80 }
81 
82 static inline void drawQuad(const Image *restrict image,
83  const int srcX,
84  const int srcY,
85  const int dstX,
86  const int dstY,
87  const int width,
88  const int height) A_NONNULL(1) A_INLINE;
89 
90 static inline void drawQuad(const Image *restrict image,
91  const int srcX,
92  const int srcY,
93  const int dstX,
94  const int dstY,
95  const int width,
96  const int height)
97 {
98  if (SafeOpenGLImageHelper::mTextureType == GL_TEXTURE_2D)
99  {
100  const float tw = static_cast<float>(image->mTexWidth);
101  const float th = static_cast<float>(image->mTexHeight);
102  // Find OpenGL normalized texture coordinates.
103  const float texX1 = static_cast<float>(srcX) / tw;
104  const float texY1 = static_cast<float>(srcY) / th;
105  const float texX2 = static_cast<float>(srcX + width) / tw;
106  const float texY2 = static_cast<float>(srcY + height) / th;
107 
108  glTexCoord2f(texX1, texY1);
109  glVertex2i(dstX, dstY);
110  glTexCoord2f(texX2, texY1);
111  glVertex2i(dstX + width, dstY);
112  glTexCoord2f(texX2, texY2);
113  glVertex2i(dstX + width, dstY + height);
114  glTexCoord2f(texX1, texY2);
115  glVertex2i(dstX, dstY + height);
116  }
117  else
118  {
119  glTexCoord2i(srcX, srcY);
120  glVertex2i(dstX, dstY);
121  glTexCoord2i(srcX + width, srcY);
122  glVertex2i(dstX + width, dstY);
123  glTexCoord2i(srcX + width, srcY + height);
124  glVertex2i(dstX + width, dstY + height);
125  glTexCoord2i(srcX, srcY + height);
126  glVertex2i(dstX, dstY + height);
127  }
128 }
129 
130 static inline void drawRescaledQuad(const Image *restrict const image,
131  const int srcX, const int srcY,
132  const int dstX, const int dstY,
133  const int width, const int height,
134  const int desiredWidth,
135  const int desiredHeight)
136  A_NONNULL(1) A_INLINE;
137 
138 static inline void drawRescaledQuad(const Image *restrict const image,
139  const int srcX, const int srcY,
140  const int dstX, const int dstY,
141  const int width, const int height,
142  const int desiredWidth,
143  const int desiredHeight)
144 {
145  if (SafeOpenGLImageHelper::mTextureType == GL_TEXTURE_2D)
146  {
147  const float tw = static_cast<float>(image->mTexWidth);
148  const float th = static_cast<float>(image->mTexHeight);
149  // Find OpenGL normalized texture coordinates.
150  const float texX1 = static_cast<float>(srcX) / tw;
151  const float texY1 = static_cast<float>(srcY) / th;
152  const float texX2 = static_cast<float>(srcX + width) / tw;
153  const float texY2 = static_cast<float>(srcY + height) / th;
154 
155  glTexCoord2f(texX1, texY1);
156  glVertex2i(dstX, dstY);
157  glTexCoord2f(texX2, texY1);
158  glVertex2i(dstX + desiredWidth, dstY);
159  glTexCoord2f(texX2, texY2);
160  glVertex2i(dstX + desiredWidth, dstY + desiredHeight);
161  glTexCoord2f(texX1, texY2);
162  glVertex2i(dstX, dstY + desiredHeight);
163  }
164  else
165  {
166  glTexCoord2i(srcX, srcY);
167  glVertex2i(dstX, dstY);
168  glTexCoord2i(srcX + width, srcY);
169  glVertex2i(dstX + desiredWidth, dstY);
170  glTexCoord2i(srcX + width, srcY + height);
171  glVertex2i(dstX + desiredWidth, dstY + desiredHeight);
172  glTexCoord2i(srcX, srcY + height);
173  glVertex2i(dstX, dstY + desiredHeight);
174  }
175 }
176 
178  int dstX, int dstY) restrict2
179 {
180  drawImageInline(image, dstX, dstY);
181 }
182 
184  int dstX, int dstY) restrict2
185 {
186  FUNC_BLOCK("Graphics::drawImage", 1)
187  if (image == nullptr)
188  return;
189 
190  setColorAlpha(image->mAlpha);
193 
194  const SDL_Rect &bounds = image->mBounds;
195  // Draw a textured quad.
196  glBegin(GL_QUADS);
197  drawQuad(image, bounds.x, bounds.y,
198  dstX, dstY, bounds.w, bounds.h);
199  glEnd();
200 }
201 
203  int dstX, int dstY) restrict2
204 {
205  drawImageInline(image, dstX, dstY);
206 }
207 
209 {
210  if (SafeOpenGLImageHelper::mTextureType == GL_TEXTURE_2D)
211  {
212  glBegin(GL_QUADS);
213  glTexCoord2f(0.0f, 0.781250f);
214  glVertex2i(0, 0);
215  glTexCoord2f(0.0f, 0.781250f);
216  glVertex2i(800, 0);
217  glTexCoord2f(0.0f, 0.585938f);
218  glVertex2i(800, 600);
219  glTexCoord2f(0.0f, 0.585938f);
220  glVertex2i(0, 600);
221  glEnd();
222  }
223  else
224  {
225  glBegin(GL_QUADS);
226  glTexCoord2i(0, 0);
227  glVertex2i(0, 0);
228  glTexCoord2i(800, 0);
229  glVertex2i(800, 0);
230  glTexCoord2i(800, 600);
231  glVertex2i(800, 600);
232  glTexCoord2i(0, 600);
233  glVertex2i(0, 600);
234  glEnd();
235  }
236 }
237 
239  int x, int y) restrict2
240 {
241  FUNC_BLOCK("Graphics::drawImageCached", 1)
242  if (image == nullptr)
243  return;
244 
245  setColorAlpha(image->mAlpha);
248 
249  const SDL_Rect &bounds = image->mBounds;
250  // Draw a textured quad.
251  glBegin(GL_QUADS);
252  drawQuad(image, bounds.x, bounds.y, x, y, bounds.w, bounds.h);
253  glEnd();
254 }
255 
257  const int x, const int y,
258  const int w, const int h) restrict2
259 {
260  FUNC_BLOCK("Graphics::drawPatternCached", 1)
261  if (image == nullptr)
262  return;
263 
264  const SDL_Rect &imageRect = image->mBounds;
265  const int iw = imageRect.w;
266  const int ih = imageRect.h;
267  if (iw == 0 || ih == 0)
268  return;
269 
270  const int srcX = imageRect.x;
271  const int srcY = imageRect.y;
272 
273  setColorAlpha(image->mAlpha);
276 
277  // Draw a set of textured rectangles
278  glBegin(GL_QUADS);
279 
280  for (int py = 0; py < h; py += ih)
281  {
282  const int height = (py + ih >= h) ? h - py : ih;
283  const int dstY = y + py;
284  for (int px = 0; px < w; px += iw)
285  {
286  int width = (px + iw >= w) ? w - px : iw;
287  int dstX = x + px;
288  drawQuad(image, srcX, srcY, dstX, dstY, width, height);
289  }
290  }
291 
292  glEnd();
293 }
294 
296 {
297 }
298 
300  int dstX, int dstY,
301  const int desiredWidth,
302  const int desiredHeight) restrict2
303 {
304  FUNC_BLOCK("Graphics::drawRescaledImage", 1)
305  if (image == nullptr)
306  return;
307 
308  const SDL_Rect &imageRect = image->mBounds;
309 
310  // Just draw the image normally when no resizing is necessary,
311  if (imageRect.w == desiredWidth && imageRect.h == desiredHeight)
312  {
313  drawImageInline(image, dstX, dstY);
314  return;
315  }
316 
317  setColorAlpha(image->mAlpha);
320 
321  // Draw a textured quad.
322  glBegin(GL_QUADS);
323  drawRescaledQuad(image, imageRect.x, imageRect.y, dstX, dstY,
324  imageRect.w, imageRect.h, desiredWidth, desiredHeight);
325  glEnd();
326 }
327 
329  const int x, const int y,
330  const int w, const int h) restrict2
331 {
332  drawPatternInline(image, x, y, w, h);
333 }
334 
336  const int x, const int y,
337  const int w, const int h) restrict2
338 {
339  FUNC_BLOCK("Graphics::drawPattern", 1)
340  if (image == nullptr)
341  return;
342 
343  const SDL_Rect &imageRect = image->mBounds;
344  const int iw = imageRect.w;
345  const int ih = imageRect.h;
346  if (iw == 0 || ih == 0)
347  return;
348 
349  const int srcX = imageRect.x;
350  const int srcY = imageRect.y;
351 
352  setColorAlpha(image->mAlpha);
355 
356  // Draw a set of textured rectangles
357  glBegin(GL_QUADS);
358 
359  for (int py = 0; py < h; py += ih)
360  {
361  const int height = (py + ih >= h) ? h - py : ih;
362  const int dstY = y + py;
363  for (int px = 0; px < w; px += iw)
364  {
365  int width = (px + iw >= w) ? w - px : iw;
366  int dstX = x + px;
367  drawQuad(image, srcX, srcY, dstX, dstY, width, height);
368  }
369  }
370 
371  glEnd();
372 }
373 
375  const int x, const int y,
376  const int w, const int h,
377  const int scaledWidth,
378  const int scaledHeight) restrict2
379 {
380  if (image == nullptr)
381  return;
382 
383  const int iw = scaledWidth;
384  const int ih = scaledHeight;
385  if (iw == 0 || ih == 0)
386  return;
387 
388  const SDL_Rect &imageRect = image->mBounds;
389  const int srcX = imageRect.x;
390  const int srcY = imageRect.y;
391 
392  setColorAlpha(image->mAlpha);
395 
396  // Draw a set of textured rectangles
397  glBegin(GL_QUADS);
398 
399  const float scaleFactorW = static_cast<float>(scaledWidth)
400  / image->getWidth();
401  const float scaleFactorH = static_cast<float>(scaledHeight)
402  / image->getHeight();
403 
404  for (int py = 0; py < h; py += ih)
405  {
406  const int height = (py + ih >= h) ? h - py : ih;
407  const int dstY = y + py;
408  for (int px = 0; px < w; px += iw)
409  {
410  int width = (px + iw >= w) ? w - px : iw;
411  int dstX = x + px;
412 
413  drawRescaledQuad(image, srcX, srcY, dstX, dstY,
414  width / scaleFactorW, height / scaleFactorH,
415  scaledWidth, scaledHeight);
416  }
417  }
418 
419  glEnd();
420 }
421 
423  vertCol A_UNUSED,
424  const Image *restrict const image
425  A_UNUSED,
426  int x A_UNUSED,
427  int y A_UNUSED) restrict2
428 {
429 }
430 
432  A_UNUSED,
433  const Image *restrict const image
434  A_UNUSED,
435  int x A_UNUSED,
436  int y A_UNUSED) const restrict2
437 {
438 }
439 
441  vert A_UNUSED,
442  const Image *restrict const
443  image A_UNUSED,
444  int x A_UNUSED,
445  int y A_UNUSED) const restrict2
446 {
447 }
448 
450  A_UNUSED,
451  const Image *restrict const image
452  A_UNUSED,
453  const int x A_UNUSED,
454  const int y A_UNUSED,
455  const int w A_UNUSED,
456  const int h A_UNUSED) const restrict2
457 {
458 }
459 
461  A_UNUSED,
462  const Image *restrict const image
463  A_UNUSED,
464  const int x A_UNUSED,
465  const int y A_UNUSED,
466  const int w A_UNUSED,
467  const int h A_UNUSED)
468  const restrict2
469 {
470 }
471 
473  A_UNUSED,
474  const Image *restrict const image
475  A_UNUSED,
476  const int x A_UNUSED,
477  const int y A_UNUSED,
478  const int w A_UNUSED,
479  const int h A_UNUSED) const restrict2
480 {
481 }
482 
484  *restrict const vert A_UNUSED)
485  restrict2
486 {
487 }
488 
490  restrict const vertCol A_UNUSED)
491  restrict2
492 {
493 }
494 
496 {
497  BLOCK_START("Graphics::updateScreen")
498  glFlush();
499  glFinish();
500 #ifdef USE_SDL2
501  SDL_GL_SwapWindow(mWindow);
502 #else
503  SDL_GL_SwapBuffers();
504 #endif // USE_SDL2
505 #ifdef DEBUG_OPENGL
506  if (isGLNotNull(mglFrameTerminator))
507  mglFrameTerminator();
508 #endif // DEBUG_OPENGL
509 
510  BLOCK_END("Graphics::updateScreen")
511 }
512 
514  A_UNUSED,
515  const int x A_UNUSED, const int y A_UNUSED,
516  const int w A_UNUSED, const int h A_UNUSED,
517  const ImageRect &restrict imgRect A_UNUSED)
518  restrict2
519 {
520 }
521 
523 {
524  glMatrixMode(GL_TEXTURE);
525  glLoadIdentity();
526 
527  glMatrixMode(GL_PROJECTION);
528  glLoadIdentity();
529 
530  glOrtho(0.0, static_cast<double>(mRect.w),
531  static_cast<double>(mRect.h),
532  0.0, -1.0, 1.0);
533 
534  glMatrixMode(GL_MODELVIEW);
535  glLoadIdentity();
536 
537  setOpenGLFlags();
538  glDisable(GL_LIGHTING);
539  glDisable(GL_FOG);
540  glDisable(GL_COLOR_MATERIAL);
541 
542  glShadeModel(GL_FLAT);
543 
544  pushClipArea(Rect(0, 0, mRect.w, mRect.h));
545 }
546 
548 {
549  popClipArea();
550 }
551 
553 {
554  int transX = 0;
555  int transY = 0;
556 
557  if (!mClipStack.empty())
558  {
559  const ClipRect &clipArea = mClipStack.top();
560  transX = -clipArea.xOffset;
561  transY = -clipArea.yOffset;
562  }
563 
565 
566  const ClipRect &clipArea = mClipStack.top();
567 
568  glPushMatrix();
569  glTranslatef(static_cast<GLfloat>(transX + clipArea.xOffset),
570  static_cast<GLfloat>(transY + clipArea.yOffset), 0);
571  glScissor(clipArea.x * mScale,
572  (mRect.h - clipArea.y - clipArea.height) * mScale,
573  clipArea.width * mScale,
574  clipArea.height * mScale);
575 }
576 
578 {
580 
581  if (mClipStack.empty())
582  return;
583 
584  glPopMatrix();
585  const ClipRect &clipArea = mClipStack.top();
586  glScissor(clipArea.x * mScale,
587  (mRect.h - clipArea.y - clipArea.height) * mScale,
588  clipArea.width * mScale,
589  clipArea.height * mScale);
590 }
591 
593 {
595  restoreColor();
596 
597  glBegin(GL_POINTS);
598  glVertex2i(x, y);
599  glEnd();
600 }
601 
602 void SafeOpenGLGraphics::drawNet(const int x1, const int y1,
603  const int x2, const int y2,
604  const int width, const int height) restrict2
605 {
607  restoreColor();
608 
609  glBegin(GL_LINES);
610  for (int y = y1; y < y2; y += height)
611  {
612  glVertex2f(static_cast<float>(x1) + 0.5F,
613  static_cast<float>(y) + 0.5F);
614  glVertex2f(static_cast<float>(x2) + 0.5F,
615  static_cast<float>(y) + 0.5F);
616  }
617 
618  for (int x = x1; x < x2; x += width)
619  {
620  glVertex2f(static_cast<float>(x) + 0.5F,
621  static_cast<float>(y1) + 0.5F);
622  glVertex2f(static_cast<float>(x) + 0.5F,
623  static_cast<float>(y2) + 0.5F);
624  }
625  glEnd();
626 }
627 
628 void SafeOpenGLGraphics::drawLine(int x1, int y1,
629  int x2, int y2) restrict2
630 {
632  restoreColor();
633 
634  glBegin(GL_LINES);
635  glVertex2f(static_cast<float>(x1) + 0.5F, static_cast<float>(y1) + 0.5F);
636  glVertex2f(static_cast<float>(x2) + 0.5F, static_cast<float>(y2) + 0.5F);
637  glEnd();
638 }
639 
641 {
642  drawRectangle(rect, false);
643 }
644 
646 {
647  drawRectangle(rect, true);
648 }
649 
651 {
652  if (!mTexture)
653  {
655  mTexture = true;
656  }
657 
658  if (!mAlpha)
659  {
660  glEnable(GL_BLEND);
661  mAlpha = true;
662  }
663 }
664 
666 {
667  mTextureBinded = 0;
668  if (mAlpha && !mColorAlpha)
669  {
670  glDisable(GL_BLEND);
671  mAlpha = false;
672  }
673  else if (!mAlpha && mColorAlpha)
674  {
675  glEnable(GL_BLEND);
676  mAlpha = true;
677  }
678 
679  if (mTexture)
680  {
682  mTexture = false;
683  }
684 }
685 
687  const bool filled) restrict2
688 {
689  BLOCK_START("Graphics::drawRectangle")
690  const float offset = filled ? 0 : 0.5F;
691 
693  restoreColor();
694 
695  glBegin(filled ? GL_QUADS : GL_LINE_LOOP);
696  glVertex2f(static_cast<float>(rect.x) + offset,
697  static_cast<float>(rect.y) + offset);
698  glVertex2f(static_cast<float>(rect.x + rect.width) - offset,
699  static_cast<float>(rect.y) + offset);
700  glVertex2f(static_cast<float>(rect.x + rect.width) - offset,
701  static_cast<float>(rect.y + rect.height) - offset);
702  glVertex2f(static_cast<float>(rect.x) + offset,
703  static_cast<float>(rect.y + rect.height) - offset);
704  glEnd();
705  BLOCK_END("Graphics::drawRectangle")
706 }
707 
708 void SafeOpenGLGraphics::bindTexture(const GLenum target,
709  const GLuint texture)
710 {
711  if (mTextureBinded != texture)
712  {
713  mTextureBinded = texture;
714  glBindTexture(target, texture);
715  }
716 }
717 
719 {
720  if (!mIsByteColor && mFloatColor == alpha)
721  return;
722 
723  glColor4f(1.0F, 1.0F, 1.0F, alpha);
724  mIsByteColor = false;
725  mFloatColor = alpha;
726 }
727 
729 {
730  if (mIsByteColor && mByteColor == mColor)
731  return;
732 
733  glColor4ub(static_cast<GLubyte>(mColor.r),
734  static_cast<GLubyte>(mColor.g),
735  static_cast<GLubyte>(mColor.b),
736  static_cast<GLubyte>(mColor.a));
737  mIsByteColor = true;
738  mByteColor = mColor;
739 }
740 
742 {
743  glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT | GL_STENCIL_BUFFER_BIT);
744 }
745 
746 void SafeOpenGLGraphics::drawImageRect(const int x, const int y,
747  const int w, const int h,
748  const ImageRect &restrict imgRect)
749  restrict2
750 {
752 }
753 
755  const int x, const int y,
756  const int w, const int h,
757  const ImageRect &restrict imgRect)
758  restrict2
759 {
761 }
762 
763 #endif // USE_OPENGL
void calcPattern(ImageVertexes *const vert, const Image *const image, const int x, const int y, const int w, const int h) const
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)
Definition: graphics.cpp:181
void setColorAlpha(const float alpha) A_INLINE
static void drawQuad(const Image *image, const int srcX, const int srcY, const int dstX, const int dstY, const int width, const int height) A_INLINE
int width
Definition: rect.h:218
void calcWindow(ImageCollection *const vertCol, const int x, const int y, const int w, const int h, const ImageRect &imgRect)
std::string mName
Definition: graphics.h:548
SDL_Surface * mWindow
Definition: graphics.h:522
RenderType mOpenGL
Definition: graphics.h:544
unsigned int a
Definition: color.h:250
#define isGLNotNull(func)
Definition: mglcheck.h:27
unsigned int g
Definition: color.h:239
Definition: rect.h:72
void drawPoint(int x, int y)
#define BLOCK_START(name)
Definition: perfomance.h:78
void drawLine(int x1, int y1, int x2, int y2)
void calcTileCollection(ImageCollection *const vertCol, const Image *const image, int x, int y)
void drawImageInline(const Image *const image, int dstX, int dstY) A_INLINE
#define BLOCK_END(name)
Definition: perfomance.h:79
int yOffset
Definition: cliprect.h:126
void drawRescaledImage(const Image *const image, int dstX, int dstY, const int desiredWidth, const int desiredHeight)
virtual void popClipArea()
Definition: graphics.cpp:738
bool setVideoMode(const int w, const int h, const int scalle, const int bpp, const bool fs, const bool hwaccel, const bool resize, const bool noFrame, const bool allowHighDPI)
void drawImageRect(int x, int y, int w, int h, const ImageRect &imgRect)
#define A_NONNULL(...)
Definition: localconsts.h:179
static GLuint mTextureBinded
void calcImageRect(ImageVertexes *const vert, int x, int y, int w, int h, const ImageRect &imgRect) A_INLINE
Color mColor
Definition: graphics.h:552
int x
Definition: rect.h:208
void copyImage(const Image *const image, int dstX, int dstY)
void drawPattern(const Image *const image, const int x, const int y, const int w, const int h)
unsigned int b
Definition: color.h:244
void drawRescaledPattern(const Image *const image, const int x, const int y, const int w, const int h, const int scaledWidth, const int scaledHeight)
void drawRectangle(const Rect &rect)
int xOffset
Definition: cliprect.h:121
int y
Definition: rect.h:213
void calcTileVertexesInline(ImageVertexes *const vert, const Image *const image, int x, int y) const A_INLINE
bool mAlpha
Definition: graphics.h:537
void drawPatternCached(const Image *const image, const int x, const int y, const int w, const int h)
int height
Definition: rect.h:223
#define FUNC_BLOCK(name, id)
Definition: perfomance.h:80
SDL_Rect mRect
Definition: graphics.h:542
void drawTileVertexes(const ImageVertexes *const vert)
void setOpenGLFlags()
Definition: graphics.cpp:747
void fillRectangle(const Rect &rect)
void drawImageCached(const Image *const image, int x, int y)
void restoreColor() A_INLINE
#define A_UNUSED
Definition: localconsts.h:171
void calcPatternInline(ImageVertexes *const vert, const Image *const image, const int x, const int y, const int w, const int h) const A_INLINE
int mScale
Definition: graphics.h:551
void calcTileVertexes(ImageVertexes *const vert, const Image *const image, int x, int y) const
static void bindTexture(const GLenum target, const GLuint texture)
MStack< ClipRect > mClipStack
Definition: graphics.h:520
Definition: image.h:61
void drawTileCollection(const ImageCollection *const vertCol)
virtual void pushClipArea(const Rect &area)
Definition: graphics.cpp:676
#define restrict
Definition: localconsts.h:176
T & top() const
Definition: mstack.h:72
void drawNet(const int x1, const int y1, const int x2, const int y2, const int width, const int height)
void drawImage(const Image *const image, int dstX, int dstY)
bool empty() const
Definition: mstack.h:87
void pushClipArea(const Rect &area)
void drawPatternInline(const Image *const image, const int x, const int y, const int w, const int h) A_INLINE
#define restrict2
Definition: localconsts.h:177
bool setOpenGLMode()
Definition: graphics.cpp:282
unsigned int r
Definition: color.h:234
static void drawRescaledQuad(const Image *const image, const int srcX, const int srcY, const int dstX, const int dstY, const int width, const int height, const int desiredWidth, const int desiredHeight) A_INLINE