orx  stable
Portable Game Engine
orxDisplay.h
Go to the documentation of this file.
1 /* Orx - Portable Game Engine
2  *
3  * Copyright (c) 2008-2017 Orx-Project
4  *
5  * This software is provided 'as-is', without any express or implied
6  * warranty. In no event will the authors be held liable for any damages
7  * arising from the use of this software.
8  *
9  * Permission is granted to anyone to use this software for any purpose,
10  * including commercial applications, and to alter it and redistribute it
11  * freely, subject to the following restrictions:
12  *
13  * 1. The origin of this software must not be misrepresented; you must not
14  * claim that you wrote the original software. If you use this software
15  * in a product, an acknowledgment in the product documentation would be
16  * appreciated but is not required.
17  *
18  * 2. Altered source versions must be plainly marked as such, and must not be
19  * misrepresented as being the original software.
20  *
21  * 3. This notice may not be removed or altered from any source
22  * distribution.
23  */
24 
43 #ifndef _orxDISPLAY_H_
44 #define _orxDISPLAY_H_
45 
46 #include "orxInclude.h"
47 #include "plugin/orxPluginCore.h"
48 
49 #include "math/orxVector.h"
50 #include "math/orxOBox.h"
51 #include "memory/orxBank.h"
52 #include "utils/orxHashTable.h"
53 #include "utils/orxString.h"
54 #include "utils/orxLinkList.h"
55 
56 
59 typedef struct __orxRGBA_t
60 {
61  union
62  {
63  struct
64  {
65  orxU8 u8R, u8G, u8B, u8A;
66  };
67 
68  orxU32 u32RGBA;
69  };
70 
71 } orxRGBA;
72 
73 #define orx2RGBA(R, G, B, A) orxRGBA_Set((orxU8)(R), (orxU8)(G), (orxU8)(B), (orxU8)(A))
74 #define orxRGBA_R(RGBA) RGBA.u8R
75 #define orxRGBA_G(RGBA) RGBA.u8G
76 #define orxRGBA_B(RGBA) RGBA.u8B
77 #define orxRGBA_A(RGBA) RGBA.u8A
78 
79 #define orxCOLOR_NORMALIZER (orx2F(1.0f / 255.0f))
80 #define orxCOLOR_DENORMALIZER (orx2F(255.0f))
81 
82 typedef struct __orxBITMAP_t orxBITMAP;
83 
84 
87 typedef struct __orxDISPLAY_VERTEX_t
88 {
89  orxFLOAT fX, fY;
90  orxFLOAT fU, fV;
92 
94 
97 typedef struct __orxDISPLAY_TRANSFORM_t
98 {
99  orxFLOAT fSrcX, fSrcY, fDstX, fDstY;
100  orxFLOAT fRepeatX, fRepeatY;
101  orxFLOAT fScaleX;
102  orxFLOAT fScaleY;
103  orxFLOAT fRotation;
104 
106 
109 typedef struct __orxDISPLAY_VIDEO_MODE_t
110 {
111  orxU32 u32Width, u32Height, u32Depth, u32RefreshRate;
112  orxBOOL bFullScreen;
113 
115 
118 typedef struct __orxCHARACTER_GLYPH_t
119 {
120  orxFLOAT fX, fY, fWidth;
121 
123 
126 typedef struct __orxCHARACTER_MAP_t
127 {
129 
132 
134 
137 typedef enum __orxDISPLAY_SMOOTHING_t
138 {
142 
144 
146 
148 
151 typedef enum __orxDISPLAY_BLEND_MODE_t
152 {
157 
159 
161 
163 
166 typedef struct __orxCOLOR_t
167 {
168  union
169  {
173  };
174  orxFLOAT fAlpha;
176 } orxCOLOR;
177 
178 
181 #define orxDISPLAY_KZ_CONFIG_SECTION "Display"
182 #define orxDISPLAY_KZ_CONFIG_WIDTH "ScreenWidth"
183 #define orxDISPLAY_KZ_CONFIG_HEIGHT "ScreenHeight"
184 #define orxDISPLAY_KZ_CONFIG_DEPTH "ScreenDepth"
185 #define orxDISPLAY_KZ_CONFIG_POSITION "ScreenPosition"
186 #define orxDISPLAY_KZ_CONFIG_REFRESH_RATE "RefreshRate"
187 #define orxDISPLAY_KZ_CONFIG_FULLSCREEN "FullScreen"
188 #define orxDISPLAY_KZ_CONFIG_ALLOW_RESIZE "AllowResize"
189 #define orxDISPLAY_KZ_CONFIG_DECORATION "Decoration"
190 #define orxDISPLAY_KZ_CONFIG_TITLE "Title"
191 #define orxDISPLAY_KZ_CONFIG_SMOOTH "Smoothing"
192 #define orxDISPLAY_KZ_CONFIG_VSYNC "VSync"
193 #define orxDISPLAY_KZ_CONFIG_DEPTHBUFFER "DepthBuffer"
194 #define orxDISPLAY_KZ_CONFIG_SHADER_VERSION "ShaderVersion"
195 #define orxDISPLAY_KZ_CONFIG_SHADER_EXTENSION_LIST "ShaderExtensionList"
196 
197 
200 #define orxDISPLAY_KZ_SHADER_SUFFIX_TOP "_top"
201 #define orxDISPLAY_KZ_SHADER_SUFFIX_LEFT "_left"
202 #define orxDISPLAY_KZ_SHADER_SUFFIX_BOTTOM "_bottom"
203 #define orxDISPLAY_KZ_SHADER_SUFFIX_RIGHT "_right"
204 
205 
208 #define orxDISPLAY_KC_SHADER_EXTENSION_ADD '+'
209 #define orxDISPLAY_KC_SHADER_EXTENSION_REMOVE '-'
210 
211 
214 typedef enum __orxDISPLAY_EVENT_t
215 {
218 
220 
221  orxDISPLAY_EVENT_NONE = orxENUM_NONE
222 
224 
227 typedef struct __orxDISPLAY_EVENT_PAYLOAD_t
228 {
229  union
230  {
231  struct
232  {
233  orxU32 u32Width;
234  orxU32 u32Height;
235  orxU32 u32Depth;
236  orxU32 u32RefreshRate;
241  orxBOOL bFullScreen;
243  } stVideoMode;
244 
245  struct
246  {
247  const orxSTRING zLocation;
248  orxU32 u32FilenameID;
249  orxU32 u32ID;
251  } stBitmap;
252  };
253 
255 
256 
257 /***************************************************************************
258  * Functions directly implemented by orx core
259  ***************************************************************************/
260 
261 #if defined(__orxIOS__) && defined(__orxOBJC__)
262 
263 #import <UIKit/UIKit.h>
264 #import <OpenGLES/EAGL.h>
265 #import <OpenGLES/ES1/gl.h>
266 #import <OpenGLES/ES1/glext.h>
267 #import <OpenGLES/ES2/gl.h>
268 #import <OpenGLES/ES2/glext.h>
269 
272 @interface orxViewController : UIViewController
273 {
274 @private
275  UIInterfaceOrientation eOrientation;
276 }
277 
278 @property UIInterfaceOrientation eOrientation;
279 
280 @end
281 
284 @interface orxView : UIView
285 {
286 @private
287  EAGLContext *poMainContext, *poThreadContext;
288  GLuint uiRenderBuffer, uiDepthBuffer, uiScreenFrameBuffer, uiTextureFrameBuffer;
289  BOOL bShaderSupport, bCompressedTextureSupport;
290 }
291 
292 + (orxView *) GetInstance;
293 
294 - (void) QueueEvent:(orxENUM)_eID WithPayload:(orxSYSTEM_EVENT_PAYLOAD *)_pstPayload;
295 - (void) NotifyAcceleration:(UIAcceleration *)_poAcceleration;
296 
297 @property (nonatomic, retain) EAGLContext *poMainContext;
298 @property (nonatomic, retain) EAGLContext *poThreadContext;
299 @property BOOL bShaderSupport;
300 @property BOOL bCompressedTextureSupport;
301 
302 @end
303 
304 #endif /* __orxIOS__ && __orxOBJC__ */
305 
306 
309 extern orxDLLAPI void orxFASTCALL orxDisplay_Setup();
310 
318 static orxINLINE orxRGBA orxRGBA_Set(orxU8 _u8R, orxU8 _u8G, orxU8 _u8B, orxU8 _u8A)
319 {
320  orxRGBA stResult;
321 
322  /* Updates result */
323  stResult.u8R = _u8R;
324  stResult.u8G = _u8G;
325  stResult.u8B = _u8B;
326  stResult.u8A = _u8A;
327 
328  /* Done! */
329  return stResult;
330 }
331 
332 
338 static orxINLINE orxCOLOR * orxColor_SetRGBA(orxCOLOR *_pstColor, orxRGBA _stRGBA)
339 {
340  orxCOLOR *pstResult = _pstColor;
341 
342  /* Checks */
343  orxASSERT(_pstColor != orxNULL);
344 
345  /* Stores RGB */
347 
348  /* Stores alpha */
349  _pstColor->fAlpha = orxCOLOR_NORMALIZER * orxRGBA_A(_stRGBA);
350 
351  /* Done! */
352  return pstResult;
353 }
354 
361 static orxINLINE orxCOLOR * orxColor_Set(orxCOLOR *_pstColor, const orxVECTOR *_pvRGB, orxFLOAT _fAlpha)
362 {
363  orxCOLOR *pstResult = _pstColor;
364 
365  /* Checks */
366  orxASSERT(_pstColor != orxNULL);
367 
368  /* Stores RGB */
369  orxVector_Copy(&(_pstColor->vRGB), _pvRGB);
370 
371  /* Stores alpha */
372  _pstColor->fAlpha = _fAlpha;
373 
374  /* Done! */
375  return pstResult;
376 }
377 
383 static orxINLINE orxCOLOR * orxColor_SetRGB(orxCOLOR *_pstColor, const orxVECTOR *_pvRGB)
384 {
385  orxCOLOR *pstResult = _pstColor;
386 
387  /* Checks */
388  orxASSERT(_pstColor != orxNULL);
389  orxASSERT(_pvRGB != orxNULL);
390 
391  /* Stores components */
392  orxVector_Copy(&(_pstColor->vRGB), _pvRGB);
393 
394  /* Done! */
395  return pstResult;
396 }
397 
403 static orxINLINE orxCOLOR * orxColor_SetAlpha(orxCOLOR *_pstColor, orxFLOAT _fAlpha)
404 {
405  orxCOLOR *pstResult = _pstColor;
406 
407  /* Checks */
408  orxASSERT(_pstColor != orxNULL);
409 
410  /* Stores it */
411  _pstColor->fAlpha = _fAlpha;
412 
413  /* Done! */
414  return pstResult;
415 }
416 
421 static orxINLINE orxRGBA orxColor_ToRGBA(const orxCOLOR *_pstColor)
422 {
423  orxRGBA stResult;
424  orxVECTOR vColor;
425  orxFLOAT fAlpha;
426 
427  /* Checks */
428  orxASSERT(_pstColor != orxNULL);
429 
430  /* Clamps RGB components */
431  orxVector_Clamp(&vColor, &(_pstColor->vRGB), &orxVECTOR_0, &orxVECTOR_WHITE);
432 
433  /* De-normalizes vector */
434  orxVector_Mulf(&vColor, &vColor, orxCOLOR_DENORMALIZER);
435 
436  /* Clamps alpha */
437  fAlpha = orxCLAMP(_pstColor->fAlpha, orxFLOAT_0, orxFLOAT_1);
438 
439  /* Updates result */
440  stResult = orx2RGBA(orxF2U(vColor.fR), orxF2U(vColor.fG), orxF2U(vColor.fB), orxF2U(orxCOLOR_DENORMALIZER * fAlpha));
441 
442  /* Done! */
443  return stResult;
444 }
445 
451 static orxINLINE orxCOLOR * orxColor_Copy(orxCOLOR *_pstDst, const orxCOLOR *_pstSrc)
452 {
453  /* Checks */
454  orxASSERT(_pstDst != orxNULL);
455  orxASSERT(_pstSrc != orxNULL);
456 
457  /* Copies it */
458  orxMemory_Copy(_pstDst, _pstSrc, sizeof(orxCOLOR));
459 
460  /* Done! */
461  return _pstDst;
462 }
463 
469 static orxCOLOR *orxFASTCALL orxColor_FromRGBToHSL(orxCOLOR *_pstDst, const orxCOLOR *_pstSrc)
470 {
471  orxCOLOR *pstResult = _pstDst;
472  orxFLOAT fMin, fMax, fDelta, fR, fG, fB;
473 
474  /* Checks */
475  orxASSERT(_pstDst != orxNULL);
476  orxASSERT(_pstSrc != orxNULL);
477 
478  /* Gets source red, blue and green components */
479  fR = _pstSrc->vRGB.fR;
480  fG = _pstSrc->vRGB.fG;
481  fB = _pstSrc->vRGB.fB;
482 
483  /* Gets min, max & delta values */
484  fMin = orxMIN(fR, orxMIN(fG, fB));
485  fMax = orxMAX(fR, orxMAX(fG, fB));
486  fDelta = fMax - fMin;
487 
488  /* Stores lightness */
489  pstResult->vHSL.fL = orx2F(0.5f) * (fMax + fMin);
490 
491  /* Gray? */
492  if(fDelta == orxFLOAT_0)
493  {
494  /* Gets hue & saturation */
495  pstResult->vHSL.fH = pstResult->vHSL.fS = orxFLOAT_0;
496  }
497  else
498  {
499  /* Updates saturation */
500  pstResult->vHSL.fS = (pstResult->vHSL.fL < orx2F(0.5f))
501  ? fDelta / (fMax + fMin)
502  : fDelta / (orx2F(2.0f) - fMax - fMin);
503 
504  /* Red tone? */
505  if(fR == fMax)
506  {
507  /* Updates hue */
508  pstResult->vHSL.fH = orx2F(1.0f / 6.0f) * (fG - fB) / fDelta;
509  }
510  /* Green tone? */
511  else if(fG == fMax)
512  {
513  /* Updates hue */
514  pstResult->vHSL.fH = orx2F(1.0f / 3.0f) + (orx2F(1.0f / 6.0f) * (fB - fR) / fDelta);
515  }
516  /* Blue tone */
517  else
518  {
519  /* Updates hue */
520  pstResult->vHSL.fH = orx2F(2.0f / 3.0f) + (orx2F(1.0f / 6.0f) * (fR - fG) / fDelta);
521  }
522 
523  /* Clamps hue */
524  if(pstResult->vHSL.fH < orxFLOAT_0)
525  {
526  pstResult->vHSL.fH += orxFLOAT_1;
527  }
528  else if(pstResult->vHSL.fH > orxFLOAT_1)
529  {
530  pstResult->vHSL.fH -= orxFLOAT_1;
531  }
532  }
533 
534  /* Updates alpha */
535  pstResult->fAlpha = _pstSrc->fAlpha;
536 
537  /* Done! */
538  return pstResult;
539 }
540 
546 static orxCOLOR *orxFASTCALL orxColor_FromHSLToRGB(orxCOLOR *_pstDst, const orxCOLOR *_pstSrc)
547 {
548  orxCOLOR *pstResult = _pstDst;
549  orxFLOAT fH, fS, fL;
550 
551 #define orxCOLOR_GET_RGB_COMPONENT(RESULT, ALT, CHROMA, HUE) \
552 do \
553 { \
554  if(HUE < orx2F(1.0f / 6.0f)) \
555  { \
556  RESULT = ALT + (orx2F(6.0f) * HUE * (CHROMA - ALT)); \
557  } \
558  else if(HUE < orx2F(1.0f / 2.0f)) \
559  { \
560  RESULT = CHROMA; \
561  } \
562  else if(HUE < orx2F(2.0f / 3.0f)) \
563  { \
564  RESULT = ALT + (orx2F(6.0f) * (CHROMA - ALT) * (orx2F(2.0f / 3.0f) - HUE)); \
565  } \
566  else \
567  { \
568  RESULT = ALT; \
569  } \
570  if(RESULT < orxMATH_KF_EPSILON) \
571  { \
572  RESULT = orxFLOAT_0; \
573  } \
574  else if(RESULT > orxFLOAT_1 - orxMATH_KF_EPSILON) \
575  { \
576  RESULT = orxFLOAT_1; \
577  } \
578 } \
579 while(orxFALSE)
580 
581  /* Checks */
582  orxASSERT(_pstDst != orxNULL);
583  orxASSERT(_pstSrc != orxNULL);
584 
585  /* Gets source hue, saturation and lightness components */
586  fH = _pstSrc->vRGB.fH;
587  fS = _pstSrc->vRGB.fS;
588  fL = _pstSrc->vRGB.fL;
589 
590  /* Gray? */
591  if(fS == orxFLOAT_0)
592  {
593  /* Updates result */
594  orxVector_SetAll(&(pstResult->vRGB), fL);
595  }
596  else
597  {
598  orxFLOAT fChroma, fIntermediate;
599 
600  /* Gets chroma */
601  fChroma = (fL < orx2F(0.5f))
602  ? fL + (fL * fS)
603  : fL + fS - (fL * fS);
604 
605  /* Gets intermediate value */
606  fIntermediate = (orx2F(2.0f) * fL) - fChroma;
607 
608  /* Gets RGB components */
609  if(fH > orx2F(2.0f / 3.0f))
610  {
611  orxCOLOR_GET_RGB_COMPONENT(pstResult->vRGB.fR, fIntermediate, fChroma, (fH - orx2F(2.0f / 3.0f)));
612  }
613  else
614  {
615  orxCOLOR_GET_RGB_COMPONENT(pstResult->vRGB.fR, fIntermediate, fChroma, (fH + orx2F(1.0f / 3.0f)));
616  }
617  orxCOLOR_GET_RGB_COMPONENT(pstResult->vRGB.fG, fIntermediate, fChroma, fH);
618  if(fH < orx2F(1.0f / 3.0f))
619  {
620  orxCOLOR_GET_RGB_COMPONENT(pstResult->vRGB.fB, fIntermediate, fChroma, (fH + orx2F(2.0f / 3.0f)));
621  }
622  else
623  {
624  orxCOLOR_GET_RGB_COMPONENT(pstResult->vRGB.fB, fIntermediate, fChroma, (fH - orx2F(1.0f / 3.0f)));
625  }
626  }
627 
628  /* Updates alpha */
629  pstResult->fAlpha = _pstSrc->fAlpha;
630 
631  /* Done! */
632  return pstResult;
633 }
634 
640 static orxCOLOR *orxFASTCALL orxColor_FromRGBToHSV(orxCOLOR *_pstDst, const orxCOLOR *_pstSrc)
641 {
642  orxCOLOR *pstResult = _pstDst;
643  orxFLOAT fMin, fMax, fDelta, fR, fG, fB;
644 
645  /* Checks */
646  orxASSERT(_pstDst != orxNULL);
647  orxASSERT(_pstSrc != orxNULL);
648 
649  /* Gets source red, blue and green components */
650  fR = _pstSrc->vRGB.fR;
651  fG = _pstSrc->vRGB.fG;
652  fB = _pstSrc->vRGB.fB;
653 
654  /* Gets min, max & delta values */
655  fMin = orxMIN(fR, orxMIN(fG, fB));
656  fMax = orxMAX(fR, orxMAX(fG, fB));
657  fDelta = fMax - fMin;
658 
659  /* Stores value */
660  pstResult->vHSL.fV = fMax;
661 
662  /* Gray? */
663  if(fDelta == orxFLOAT_0)
664  {
665  /* Gets hue & saturation */
666  pstResult->vHSL.fH = pstResult->vHSL.fS = orxFLOAT_0;
667  }
668  else
669  {
670  /* Updates saturation */
671  pstResult->vHSL.fS = fDelta / fMax;
672 
673  /* Red tone? */
674  if(fR == fMax)
675  {
676  /* Updates hue */
677  pstResult->vHSL.fH = orx2F(1.0f / 6.0f) * (fG - fB) / fDelta;
678  }
679  /* Green tone? */
680  else if(fG == fMax)
681  {
682  /* Updates hue */
683  pstResult->vHSL.fH = orx2F(1.0f / 3.0f) + (orx2F(1.0f / 6.0f) * (fB - fR) / fDelta);
684  }
685  /* Blue tone */
686  else
687  {
688  /* Updates hue */
689  pstResult->vHSL.fH = orx2F(2.0f / 3.0f) + (orx2F(1.0f / 6.0f) * (fR - fG) / fDelta);
690  }
691 
692  /* Clamps hue */
693  if(pstResult->vHSL.fH < orxFLOAT_0)
694  {
695  pstResult->vHSL.fH += orxFLOAT_1;
696  }
697  else if(pstResult->vHSL.fH > orxFLOAT_1)
698  {
699  pstResult->vHSL.fH -= orxFLOAT_1;
700  }
701  }
702 
703  /* Updates alpha */
704  pstResult->fAlpha = _pstSrc->fAlpha;
705 
706  /* Done! */
707  return pstResult;
708 }
709 
715 static orxCOLOR *orxFASTCALL orxColor_FromHSVToRGB(orxCOLOR *_pstDst, const orxCOLOR *_pstSrc)
716 {
717  orxCOLOR *pstResult = _pstDst;
718  orxFLOAT fH, fS, fV;
719 
720  /* Checks */
721  orxASSERT(_pstDst != orxNULL);
722  orxASSERT(_pstSrc != orxNULL);
723 
724  /* Gets source hue, saturation and value components */
725  fH = _pstSrc->vRGB.fH;
726  fS = _pstSrc->vRGB.fS;
727  fV = _pstSrc->vRGB.fV;
728 
729  /* Gray? */
730  if(fS == orxFLOAT_0)
731  {
732  /* Updates result */
733  orxVector_SetAll(&(pstResult->vRGB), fV);
734  }
735  else
736  {
737  orxFLOAT fFullHue, fSector, fIntermediate;
738 
739  /* Gets intermediate value */
740  fIntermediate = fV * fS;
741 
742  /* Gets full hue & sector */
743  fFullHue = orx2F(6.0f) * fH;
744  fSector = orxMath_Floor(fFullHue);
745 
746  /* Depending on sector */
747  switch(orxF2U(fSector))
748  {
749  default:
750  case 0:
751  {
752  /* Updates RGB components */
753  pstResult->vRGB.fR = fV;
754  pstResult->vRGB.fG = fV - (fIntermediate - (fIntermediate * (fFullHue - fSector)));
755  pstResult->vRGB.fB = fV - fIntermediate;
756 
757  break;
758  }
759 
760  case 1:
761  {
762  /* Updates RGB components */
763  pstResult->vRGB.fR = fV - (fIntermediate * (fFullHue - fSector));
764  pstResult->vRGB.fG = fV;
765  pstResult->vRGB.fB = fV - fIntermediate;
766 
767  break;
768  }
769 
770  case 2:
771  {
772  /* Updates RGB components */
773  pstResult->vRGB.fR = fV - fIntermediate;
774  pstResult->vRGB.fG = fV;
775  pstResult->vRGB.fB = fV - (fIntermediate - (fIntermediate * (fFullHue - fSector)));
776 
777  break;
778  }
779 
780  case 3:
781  {
782  /* Updates RGB components */
783  pstResult->vRGB.fR = fV - fIntermediate;
784  pstResult->vRGB.fG = fV - (fIntermediate * (fFullHue - fSector));
785  pstResult->vRGB.fB = fV;
786 
787  break;
788  }
789 
790  case 4:
791  {
792  /* Updates RGB components */
793  pstResult->vRGB.fR = fV - (fIntermediate - (fIntermediate * (fFullHue - fSector)));
794  pstResult->vRGB.fG = fV - fIntermediate;
795  pstResult->vRGB.fB = fV;
796 
797  break;
798  }
799 
800  case 5:
801  {
802  /* Updates RGB components */
803  pstResult->vRGB.fR = fV;
804  pstResult->vRGB.fG = fV - fIntermediate;
805  pstResult->vRGB.fB = fV - (fIntermediate * (fFullHue - fSector));
806 
807  break;
808  }
809  }
810  }
811 
812  /* Updates alpha */
813  pstResult->fAlpha = _pstSrc->fAlpha;
814 
815  /* Done! */
816  return pstResult;
817 }
818 
823 extern orxDLLAPI orxDISPLAY_BLEND_MODE orxFASTCALL orxDisplay_GetBlendModeFromString(const orxSTRING _zBlendMode);
824 
825 
826 /***************************************************************************
827  * Functions extended by plugins
828  ***************************************************************************/
829 
833 extern orxDLLAPI orxSTATUS orxFASTCALL orxDisplay_Init();
834 
837 extern orxDLLAPI void orxFASTCALL orxDisplay_Exit();
838 
839 
843 extern orxDLLAPI orxSTATUS orxFASTCALL orxDisplay_Swap();
844 
845 
849 extern orxDLLAPI orxBITMAP *orxFASTCALL orxDisplay_GetScreenBitmap();
850 
856 extern orxDLLAPI orxSTATUS orxFASTCALL orxDisplay_GetScreenSize(orxFLOAT *_pfWidth, orxFLOAT *_pfHeight);
857 
858 
864 extern orxDLLAPI orxBITMAP *orxFASTCALL orxDisplay_CreateBitmap(orxU32 _u32Width, orxU32 _u32Height);
865 
869 extern orxDLLAPI void orxFASTCALL orxDisplay_DeleteBitmap(orxBITMAP *_pstBitmap);
870 
871 
876 extern orxDLLAPI orxBITMAP *orxFASTCALL orxDisplay_LoadBitmap(const orxSTRING _zFileName);
877 
883 extern orxDLLAPI orxSTATUS orxFASTCALL orxDisplay_SaveBitmap(const orxBITMAP *_pstBitmap, const orxSTRING _zFileName);
884 
885 
890 extern orxDLLAPI orxSTATUS orxFASTCALL orxDisplay_SetTempBitmap(const orxBITMAP *_pstBitmap);
891 
895 extern orxDLLAPI const orxBITMAP *orxFASTCALL orxDisplay_GetTempBitmap();
896 
897 
903 extern orxDLLAPI orxSTATUS orxFASTCALL orxDisplay_SetDestinationBitmaps(orxBITMAP **_apstBitmapList, orxU32 _u32Number);
904 
910 extern orxDLLAPI orxSTATUS orxFASTCALL orxDisplay_ClearBitmap(orxBITMAP *_pstBitmap, orxRGBA _stColor);
911 
916 extern orxDLLAPI orxSTATUS orxFASTCALL orxDisplay_SetBlendMode(orxDISPLAY_BLEND_MODE _eBlendMode);
917 
926 extern orxDLLAPI orxSTATUS orxFASTCALL orxDisplay_SetBitmapClipping(orxBITMAP *_pstBitmap, orxU32 _u32TLX, orxU32 _u32TLY, orxU32 _u32BRX, orxU32 _u32BRY);
927 
934 extern orxDLLAPI orxSTATUS orxFASTCALL orxDisplay_SetBitmapColorKey(orxBITMAP *_pstBitmap, orxRGBA _stColor, orxBOOL _bEnable);
935 
942 extern orxDLLAPI orxSTATUS orxFASTCALL orxDisplay_SetBitmapData(orxBITMAP *_pstBitmap, const orxU8 *_au8Data, orxU32 _u32ByteNumber);
943 
950 extern orxDLLAPI orxSTATUS orxFASTCALL orxDisplay_GetBitmapData(const orxBITMAP *_pstBitmap, orxU8 *_au8Data, orxU32 _u32ByteNumber);
951 
957 extern orxDLLAPI orxSTATUS orxFASTCALL orxDisplay_SetBitmapColor(orxBITMAP *_pstBitmap, orxRGBA _stColor);
958 
963 extern orxDLLAPI orxRGBA orxFASTCALL orxDisplay_GetBitmapColor(const orxBITMAP *_pstBitmap);
964 
971 extern orxDLLAPI orxSTATUS orxFASTCALL orxDisplay_GetBitmapSize(const orxBITMAP *_pstBitmap, orxFLOAT *_pfWidth, orxFLOAT *_pfHeight);
972 
973 
978 extern orxDLLAPI orxU32 orxFASTCALL orxDisplay_GetBitmapID(const orxBITMAP *_pstBitmap);
979 
987 extern orxDLLAPI orxSTATUS orxFASTCALL orxDisplay_TransformBitmap(const orxBITMAP *_pstSrc, const orxDISPLAY_TRANSFORM *_pstTransform, orxDISPLAY_SMOOTHING _eSmoothing, orxDISPLAY_BLEND_MODE _eBlendMode);
988 
998 extern orxDLLAPI orxSTATUS orxFASTCALL orxDisplay_TransformText(const orxSTRING _zString, const orxBITMAP *_pstFont, const orxCHARACTER_MAP *_pstMap, const orxDISPLAY_TRANSFORM *_pstTransform, orxDISPLAY_SMOOTHING _eSmoothing, orxDISPLAY_BLEND_MODE _eBlendMode);
999 
1000 
1007 extern orxDLLAPI orxSTATUS orxFASTCALL orxDisplay_DrawLine(const orxVECTOR *_pvStart, const orxVECTOR *_pvEnd, orxRGBA _stColor);
1008 
1015 extern orxDLLAPI orxSTATUS orxFASTCALL orxDisplay_DrawPolyline(const orxVECTOR *_avVertexList, orxU32 _u32VertexNumber, orxRGBA _stColor);
1016 
1024 extern orxDLLAPI orxSTATUS orxFASTCALL orxDisplay_DrawPolygon(const orxVECTOR *_avVertexList, orxU32 _u32VertexNumber, orxRGBA _stColor, orxBOOL _bFill);
1025 
1033 extern orxDLLAPI orxSTATUS orxFASTCALL orxDisplay_DrawCircle(const orxVECTOR *_pvCenter, orxFLOAT _fRadius, orxRGBA _stColor, orxBOOL _bFill);
1034 
1041 extern orxDLLAPI orxSTATUS orxFASTCALL orxDisplay_DrawOBox(const orxOBOX *_pstBox, orxRGBA _stColor, orxBOOL _bFill);
1042 
1051 extern orxDLLAPI orxSTATUS orxFASTCALL orxDisplay_DrawMesh(const orxBITMAP *_pstBitmap, orxDISPLAY_SMOOTHING _eSmoothing, orxDISPLAY_BLEND_MODE _eBlendMode, orxU32 _u32VertexNumber, const orxDISPLAY_VERTEX *_astVertexList);
1052 
1056 extern orxDLLAPI orxBOOL orxFASTCALL orxDisplay_HasShaderSupport();
1057 
1065 extern orxDLLAPI orxHANDLE orxFASTCALL orxDisplay_CreateShader(const orxSTRING *_azCodeList, orxU32 _u32Size, const orxLINKLIST *_pstParamList, orxBOOL _bUseCustomParam);
1066 
1070 extern orxDLLAPI void orxFASTCALL orxDisplay_DeleteShader(orxHANDLE _hShader);
1071 
1076 extern orxDLLAPI orxSTATUS orxFASTCALL orxDisplay_StartShader(const orxHANDLE _hShader);
1077 
1082 extern orxDLLAPI orxSTATUS orxFASTCALL orxDisplay_StopShader(const orxHANDLE _hShader);
1083 
1091 extern orxDLLAPI orxS32 orxFASTCALL orxDisplay_GetParameterID(orxHANDLE _hShader, const orxSTRING _zParam, orxS32 _s32Index, orxBOOL _bIsTexture);
1092 
1099 extern orxDLLAPI orxSTATUS orxFASTCALL orxDisplay_SetShaderBitmap(orxHANDLE _hShader, orxS32 _s32ID, const orxBITMAP *_pstValue);
1100 
1107 extern orxDLLAPI orxSTATUS orxFASTCALL orxDisplay_SetShaderFloat(orxHANDLE _hShader, orxS32 _s32ID, orxFLOAT _fValue);
1108 
1115 extern orxDLLAPI orxSTATUS orxFASTCALL orxDisplay_SetShaderVector(orxHANDLE _hShader, orxS32 _s32ID, const orxVECTOR *_pvValue);
1116 
1117 
1122 extern orxDLLAPI orxSTATUS orxFASTCALL orxDisplay_EnableVSync(orxBOOL _bEnable);
1123 
1127 extern orxDLLAPI orxBOOL orxFASTCALL orxDisplay_IsVSyncEnabled();
1128 
1129 
1134 extern orxDLLAPI orxSTATUS orxFASTCALL orxDisplay_SetFullScreen(orxBOOL _bFullScreen);
1135 
1139 extern orxDLLAPI orxBOOL orxFASTCALL orxDisplay_IsFullScreen();
1140 
1141 
1145 extern orxDLLAPI orxU32 orxFASTCALL orxDisplay_GetVideoModeCounter();
1146 
1152 extern orxDLLAPI orxDISPLAY_VIDEO_MODE *orxFASTCALL orxDisplay_GetVideoMode(orxU32 _u32Index, orxDISPLAY_VIDEO_MODE *_pstVideoMode);
1153 
1158 extern orxDLLAPI orxSTATUS orxFASTCALL orxDisplay_SetVideoMode(const orxDISPLAY_VIDEO_MODE *_pstVideoMode);
1159 
1164 extern orxDLLAPI orxBOOL orxFASTCALL orxDisplay_IsVideoModeAvailable(const orxDISPLAY_VIDEO_MODE *_pstVideoMode);
1165 
1166 
1167 #endif /* _orxDISPLAY_H_ */
1168 
orxU32 u32RGBA
Definition: orxDisplay.h:68
orxDLLAPI orxSTATUS orxFASTCALL orxDisplay_StopShader(const orxHANDLE _hShader)
#define orxCOLOR_GET_RGB_COMPONENT(RESULT, ALT, CHROMA, HUE)
struct __orxHASHTABLE_t orxHASHTABLE
Definition: orxHashTable.h:50
orxDISPLAY_SMOOTHING
Definition: orxDisplay.h:137
orxFLOAT fB
Definition: orxVector.h:78
static orxINLINE orxVECTOR * orxVector_Mulf(orxVECTOR *_pvRes, const orxVECTOR *_pvOp1, orxFLOAT _fOp2)
Definition: orxVector.h:189
static orxCOLOR *orxFASTCALL orxColor_FromHSVToRGB(orxCOLOR *_pstDst, const orxCOLOR *_pstSrc)
Definition: orxDisplay.h:715
orxDISPLAY_EVENT
Definition: orxDisplay.h:214
orxVECTOR vHSV
Definition: orxDisplay.h:172
orxDLLAPI orxSTATUS orxFASTCALL orxDisplay_ClearBitmap(orxBITMAP *_pstBitmap, orxRGBA _stColor)
struct __orxBITMAP_t orxBITMAP
Definition: orxDisplay.h:82
#define orxRGBA_R(RGBA)
Definition: orxDisplay.h:74
#define orxF2U(V)
Definition: orxMath.h:92
orxDLLAPI orxSTATUS orxFASTCALL orxDisplay_SetShaderVector(orxHANDLE _hShader, orxS32 _s32ID, const orxVECTOR *_pvValue)
orxDLLAPI orxSTATUS orxFASTCALL orxDisplay_SetBitmapColor(orxBITMAP *_pstBitmap, orxRGBA _stColor)
orxDLLAPI void orxFASTCALL orxDisplay_DeleteShader(orxHANDLE _hShader)
static const orxFLOAT orxFLOAT_1
Definition: orxType.h:191
orxDLLAPI orxBOOL orxFASTCALL orxDisplay_IsFullScreen()
static orxINLINE orxRGBA orxColor_ToRGBA(const orxCOLOR *_pstColor)
Definition: orxDisplay.h:421
orxDLLAPI orxSTATUS orxFASTCALL orxDisplay_GetBitmapSize(const orxBITMAP *_pstBitmap, orxFLOAT *_pfWidth, orxFLOAT *_pfHeight)
orxDLLAPI orxSTATUS orxFASTCALL orxDisplay_SetBitmapData(orxBITMAP *_pstBitmap, const orxU8 *_au8Data, orxU32 _u32ByteNumber)
orxDLLAPI const orxBITMAP *orxFASTCALL orxDisplay_GetTempBitmap()
#define orxMIN(A, B)
Definition: orxMath.h:71
orxDLLAPI void orxFASTCALL orxDisplay_Setup()
orxFLOAT fAlpha
Definition: orxDisplay.h:174
orxDLLAPI orxSTATUS orxFASTCALL orxDisplay_SetShaderFloat(orxHANDLE _hShader, orxS32 _s32ID, orxFLOAT _fValue)
orxDLLAPI orxSTATUS orxFASTCALL orxDisplay_Init()
orxDLLAPI orxSTATUS orxFASTCALL orxDisplay_GetScreenSize(orxFLOAT *_pfWidth, orxFLOAT *_pfHeight)
#define orxCLAMP(V, MIN, MAX)
Definition: orxMath.h:86
orxDLLAPI orxBOOL orxFASTCALL orxDisplay_IsVSyncEnabled()
orxDLLAPI orxSTATUS orxFASTCALL orxDisplay_StartShader(const orxHANDLE _hShader)
static orxCOLOR *orxFASTCALL orxColor_FromRGBToHSL(orxCOLOR *_pstDst, const orxCOLOR *_pstSrc)
Definition: orxDisplay.h:469
static orxCOLOR *orxFASTCALL orxColor_FromRGBToHSV(orxCOLOR *_pstDst, const orxCOLOR *_pstSrc)
Definition: orxDisplay.h:640
static orxINLINE orxCOLOR * orxColor_SetRGB(orxCOLOR *_pstColor, const orxVECTOR *_pvRGB)
Definition: orxDisplay.h:383
orxDLLAPI orxU32 orxFASTCALL orxDisplay_GetBitmapID(const orxBITMAP *_pstBitmap)
orxFLOAT fS
Definition: orxVector.h:71
static orxINLINE orxFLOAT orxMath_Floor(orxFLOAT _fOp)
Definition: orxMath.h:415
orxDLLAPI orxSTATUS orxFASTCALL orxDisplay_SaveBitmap(const orxBITMAP *_pstBitmap, const orxSTRING _zFileName)
orxDLLAPI orxRGBA orxFASTCALL orxDisplay_GetBitmapColor(const orxBITMAP *_pstBitmap)
static orxINLINE orxVECTOR * orxVector_Set(orxVECTOR *_pvVec, orxFLOAT _fX, orxFLOAT _fY, orxFLOAT _fZ)
Definition: orxVector.h:96
orxDLLAPI orxSTATUS orxFASTCALL orxDisplay_Swap()
orxDLLAPI orxSTATUS orxFASTCALL orxDisplay_TransformText(const orxSTRING _zString, const orxBITMAP *_pstFont, const orxCHARACTER_MAP *_pstMap, const orxDISPLAY_TRANSFORM *_pstTransform, orxDISPLAY_SMOOTHING _eSmoothing, orxDISPLAY_BLEND_MODE _eBlendMode)
orxHASHTABLE * pstCharacterTable
Definition: orxDisplay.h:131
#define orxRGBA_B(RGBA)
Definition: orxDisplay.h:76
#define orxCOLOR_DENORMALIZER
Definition: orxDisplay.h:80
static orxCOLOR *orxFASTCALL orxColor_FromHSLToRGB(orxCOLOR *_pstDst, const orxCOLOR *_pstSrc)
Definition: orxDisplay.h:546
orxBANK * pstCharacterBank
Definition: orxDisplay.h:130
orxDLLAPI orxDISPLAY_VIDEO_MODE *orxFASTCALL orxDisplay_GetVideoMode(orxU32 _u32Index, orxDISPLAY_VIDEO_MODE *_pstVideoMode)
orxDLLAPI orxSTATUS orxFASTCALL orxDisplay_DrawLine(const orxVECTOR *_pvStart, const orxVECTOR *_pvEnd, orxRGBA _stColor)
#define orxCOLOR_NORMALIZER
Definition: orxDisplay.h:79
#define orxU2F(V)
Definition: orxMath.h:104
static orxINLINE orxCOLOR * orxColor_Set(orxCOLOR *_pstColor, const orxVECTOR *_pvRGB, orxFLOAT _fAlpha)
Definition: orxDisplay.h:361
orxFLOAT fG
Definition: orxVector.h:70
#define orxMAX(A, B)
Definition: orxMath.h:78
static orxINLINE orxVECTOR * orxVector_Clamp(orxVECTOR *_pvRes, const orxVECTOR *_pvOp, const orxVECTOR *_pvMin, const orxVECTOR *_pvMax)
Definition: orxVector.h:350
orxVECTOR vHSL
Definition: orxDisplay.h:171
orxDLLAPI orxSTATUS orxFASTCALL orxDisplay_SetBitmapColorKey(orxBITMAP *_pstBitmap, orxRGBA _stColor, orxBOOL _bEnable)
orxDLLAPI orxSTATUS orxFASTCALL orxDisplay_SetBlendMode(orxDISPLAY_BLEND_MODE _eBlendMode)
orxDLLAPI orxSTATUS orxFASTCALL orxDisplay_SetVideoMode(const orxDISPLAY_VIDEO_MODE *_pstVideoMode)
orxDLLAPI orxSTATUS orxFASTCALL orxDisplay_DrawOBox(const orxOBOX *_pstBox, orxRGBA _stColor, orxBOOL _bFill)
orxVECTOR vRGB
Definition: orxDisplay.h:170
orxFLOAT fR
Definition: orxVector.h:62
orxSTATUS
Definition: orxType.h:243
orxDLLAPI orxS32 orxFASTCALL orxDisplay_GetParameterID(orxHANDLE _hShader, const orxSTRING _zParam, orxS32 _s32Index, orxBOOL _bIsTexture)
orxDLLAPI orxBITMAP *orxFASTCALL orxDisplay_LoadBitmap(const orxSTRING _zFileName)
orxDLLAPI orxSTATUS orxFASTCALL orxDisplay_TransformBitmap(const orxBITMAP *_pstSrc, const orxDISPLAY_TRANSFORM *_pstTransform, orxDISPLAY_SMOOTHING _eSmoothing, orxDISPLAY_BLEND_MODE _eBlendMode)
orxDLLAPI orxSTATUS orxFASTCALL orxDisplay_SetBitmapClipping(orxBITMAP *_pstBitmap, orxU32 _u32TLX, orxU32 _u32TLY, orxU32 _u32BRX, orxU32 _u32BRY)
orxU8 u8B
Definition: orxDisplay.h:65
orxDLLAPI orxSTATUS orxFASTCALL orxDisplay_SetFullScreen(orxBOOL _bFullScreen)
orxDLLAPI orxSTATUS orxFASTCALL orxDisplay_GetBitmapData(const orxBITMAP *_pstBitmap, orxU8 *_au8Data, orxU32 _u32ByteNumber)
#define orxRGBA_A(RGBA)
Definition: orxDisplay.h:77
#define orx2RGBA(R, G, B, A)
Definition: orxDisplay.h:73
orxU8 u8G
Definition: orxDisplay.h:65
orxDLLAPI orxSTATUS orxFASTCALL orxDisplay_EnableVSync(orxBOOL _bEnable)
typedef void(orxFASTCALL *orxMODULE_EXIT_FUNCTION)()
static orxINLINE orxCOLOR * orxColor_SetRGBA(orxCOLOR *_pstColor, orxRGBA _stRGBA)
Definition: orxDisplay.h:338
#define orxDLLAPI
Definition: orxDecl.h:387
orxDLLAPI orxSTATUS orxFASTCALL orxDisplay_SetDestinationBitmaps(orxBITMAP **_apstBitmapList, orxU32 _u32Number)
#define orxRGBA_G(RGBA)
Definition: orxDisplay.h:75
orxDLLAPI orxBITMAP *orxFASTCALL orxDisplay_CreateBitmap(orxU32 _u32Width, orxU32 _u32Height)
orxDLLAPI orxBITMAP *orxFASTCALL orxDisplay_GetScreenBitmap()
static orxINLINE orxRGBA orxRGBA_Set(orxU8 _u8R, orxU8 _u8G, orxU8 _u8B, orxU8 _u8A)
Definition: orxDisplay.h:318
orxFLOAT fV
Definition: orxVector.h:80
orxDLLAPI orxSTATUS orxFASTCALL orxDisplay_DrawCircle(const orxVECTOR *_pvCenter, orxFLOAT _fRadius, orxRGBA _stColor, orxBOOL _bFill)
orxDISPLAY_BLEND_MODE
Definition: orxDisplay.h:151
orxDLLAPI orxSTATUS orxFASTCALL orxDisplay_DrawPolygon(const orxVECTOR *_avVertexList, orxU32 _u32VertexNumber, orxRGBA _stColor, orxBOOL _bFill)
orxDLLAPI orxSTATUS orxFASTCALL orxDisplay_SetShaderBitmap(orxHANDLE _hShader, orxS32 _s32ID, const orxBITMAP *_pstValue)
static orxINLINE orxVECTOR * orxVector_SetAll(orxVECTOR *_pvVec, orxFLOAT _fValue)
Definition: orxVector.h:115
orxU8 u8A
Definition: orxDisplay.h:65
orxDLLAPI const orxVECTOR orxVECTOR_WHITE
static const orxFLOAT orxFLOAT_0
Definition: orxType.h:190
struct __orxBANK_t orxBANK
Definition: orxBank.h:56
orxDLLAPI orxHANDLE orxFASTCALL orxDisplay_CreateShader(const orxSTRING *_azCodeList, orxU32 _u32Size, const orxLINKLIST *_pstParamList, orxBOOL _bUseCustomParam)
orxU8 u8R
Definition: orxDisplay.h:65
orxDLLAPI const orxVECTOR orxVECTOR_0
orxDLLAPI orxBOOL orxFASTCALL orxDisplay_HasShaderSupport()
orxDLLAPI orxBOOL orxFASTCALL orxDisplay_IsVideoModeAvailable(const orxDISPLAY_VIDEO_MODE *_pstVideoMode)
orxFLOAT fCharacterHeight
Definition: orxDisplay.h:128
static orxINLINE void * orxMemory_Copy(void *_pDest, const void *_pSrc, orxU32 _u32Size)
Definition: orxMemory.h:159
orxDLLAPI orxU32 orxFASTCALL orxDisplay_GetVideoModeCounter()
orxDLLAPI orxSTATUS orxFASTCALL orxDisplay_SetTempBitmap(const orxBITMAP *_pstBitmap)
orxDLLAPI orxSTATUS orxFASTCALL orxDisplay_DrawMesh(const orxBITMAP *_pstBitmap, orxDISPLAY_SMOOTHING _eSmoothing, orxDISPLAY_BLEND_MODE _eBlendMode, orxU32 _u32VertexNumber, const orxDISPLAY_VERTEX *_astVertexList)
static orxINLINE orxCOLOR * orxColor_Copy(orxCOLOR *_pstDst, const orxCOLOR *_pstSrc)
Definition: orxDisplay.h:451
orxFLOAT fL
Definition: orxVector.h:79
#define orxASSERT(TEST,...)
Definition: orxDebug.h:298
static orxINLINE orxCOLOR * orxColor_SetAlpha(orxCOLOR *_pstColor, orxFLOAT _fAlpha)
Definition: orxDisplay.h:403
orxDLLAPI void orxFASTCALL orxDisplay_DeleteBitmap(orxBITMAP *_pstBitmap)
static orxINLINE orxVECTOR * orxVector_Copy(orxVECTOR *_pvDst, const orxVECTOR *_pvSrc)
Definition: orxVector.h:126
const orxSTRING zLocation
Definition: orxDisplay.h:247
orxDLLAPI orxSTATUS orxFASTCALL orxDisplay_DrawPolyline(const orxVECTOR *_avVertexList, orxU32 _u32VertexNumber, orxRGBA _stColor)
orxFLOAT fH
Definition: orxVector.h:63
orxDLLAPI orxDISPLAY_BLEND_MODE orxFASTCALL orxDisplay_GetBlendModeFromString(const orxSTRING _zBlendMode)
orxDLLAPI void orxFASTCALL orxDisplay_Exit()

Generated for orx by doxygen 1.5.6