orx  1.11
Portable Game Engine
orxDisplay.h
Go to the documentation of this file.
1 /* Orx - Portable Game Engine
2  *
3  * Copyright (c) 2008-2020 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 enum __orxDISPLAY_PRIMITIVE_t
110 {
118 
120 
122 
124 
127 typedef struct __orxDISPLAY_MESH_t
128 {
130  const orxU16 * au16IndexList;
134 
136 
139 typedef struct __orxDISPLAY_VIDEO_MODE_t
140 {
141  orxU32 u32Width, u32Height, u32Depth, u32RefreshRate;
142  orxBOOL bFullScreen;
143 
145 
148 typedef struct __orxCHARACTER_GLYPH_t
149 {
150  orxFLOAT fX, fY, fWidth;
151 
153 
156 typedef struct __orxCHARACTER_MAP_t
157 {
159 
162 
164 
167 typedef enum __orxDISPLAY_SMOOTHING_t
168 {
172 
174 
176 
178 
181 typedef enum __orxDISPLAY_BLEND_MODE_t
182 {
187 
189 
191 
193 
196 typedef struct __orxCOLOR_t
197 {
198  union
199  {
203  };
204  orxFLOAT fAlpha;
206 } orxCOLOR;
207 
208 
211 #define orxDISPLAY_KZ_CONFIG_SECTION "Display"
212 #define orxDISPLAY_KZ_CONFIG_WIDTH "ScreenWidth"
213 #define orxDISPLAY_KZ_CONFIG_HEIGHT "ScreenHeight"
214 #define orxDISPLAY_KZ_CONFIG_DEPTH "ScreenDepth"
215 #define orxDISPLAY_KZ_CONFIG_POSITION "ScreenPosition"
216 #define orxDISPLAY_KZ_CONFIG_REFRESH_RATE "RefreshRate"
217 #define orxDISPLAY_KZ_CONFIG_FULLSCREEN "FullScreen"
218 #define orxDISPLAY_KZ_CONFIG_ALLOW_RESIZE "AllowResize"
219 #define orxDISPLAY_KZ_CONFIG_DECORATION "Decoration"
220 #define orxDISPLAY_KZ_CONFIG_TITLE "Title"
221 #define orxDISPLAY_KZ_CONFIG_SMOOTH "Smoothing"
222 #define orxDISPLAY_KZ_CONFIG_VSYNC "VSync"
223 #define orxDISPLAY_KZ_CONFIG_DEPTHBUFFER "DepthBuffer"
224 #define orxDISPLAY_KZ_CONFIG_SHADER_VERSION "ShaderVersion"
225 #define orxDISPLAY_KZ_CONFIG_SHADER_EXTENSION_LIST "ShaderExtensionList"
226 #define orxDISPLAY_KZ_CONFIG_MONITOR "Monitor"
227 #define orxDISPLAY_KZ_CONFIG_CURSOR "Cursor"
228 #define orxDISPLAY_KZ_CONFIG_ICON_LIST "IconList"
229 #define orxDISPLAY_KZ_CONFIG_FRAMEBUFFER_SIZE "FramebufferSize"
230 #define orxDISPLAY_KZ_CONFIG_TEXTURE_UNIT_NUMBER "TextureUnitNumber"
231 #define orxDISPLAY_KZ_CONFIG_DRAW_BUFFER_NUMBER "DrawBufferNumber"
232 
233 
236 #define orxDISPLAY_KZ_SHADER_SUFFIX_TOP "_top"
237 #define orxDISPLAY_KZ_SHADER_SUFFIX_LEFT "_left"
238 #define orxDISPLAY_KZ_SHADER_SUFFIX_BOTTOM "_bottom"
239 #define orxDISPLAY_KZ_SHADER_SUFFIX_RIGHT "_right"
240 
241 
244 #define orxDISPLAY_KC_SHADER_EXTENSION_ADD '+'
245 #define orxDISPLAY_KC_SHADER_EXTENSION_REMOVE '-'
246 
247 
250 typedef enum __orxDISPLAY_EVENT_t
251 {
254 
256 
257  orxDISPLAY_EVENT_NONE = orxENUM_NONE
258 
260 
263 typedef struct __orxDISPLAY_EVENT_PAYLOAD_t
264 {
265  union
266  {
267  struct
268  {
269  orxU32 u32Width;
270  orxU32 u32Height;
271  orxU32 u32Depth;
272  orxU32 u32RefreshRate;
277  orxBOOL bFullScreen;
279  } stVideoMode;
280 
281  struct
282  {
283  const orxSTRING zLocation;
284  orxSTRINGID stFilenameID;
285  orxU32 u32ID;
287  } stBitmap;
288  };
289 
291 
292 
293 /***************************************************************************
294  * Functions directly implemented by orx core
295  ***************************************************************************/
296 
297 #if defined(__orxIOS__) && defined(__orxOBJC__)
298 
299 #import <UIKit/UIKit.h>
300 #import <OpenGLES/EAGL.h>
301 #import <OpenGLES/ES1/gl.h>
302 #import <OpenGLES/ES1/glext.h>
303 #import <OpenGLES/ES2/gl.h>
304 #import <OpenGLES/ES2/glext.h>
305 
308 @interface orxViewController : UIViewController
309 {
310 @private
311  UIInterfaceOrientation eOrientation;
312 }
313 
314 @property UIInterfaceOrientation eOrientation;
315 
316 @end
317 
320 @interface orxView : UIView
321 {
322 @private
323  EAGLContext *poMainContext, *poThreadContext;
324  GLuint uiRenderBuffer, uiDepthBuffer, uiScreenFrameBuffer, uiTextureFrameBuffer;
325  BOOL bShaderSupport, bCompressedTextureSupport;
326 }
327 
328 + (orxView *) GetInstance;
329 
330 - (void) QueueEvent:(orxENUM)_eID WithPayload:(orxSYSTEM_EVENT_PAYLOAD *)_pstPayload;
331 - (void) NotifyAcceleration:(UIAcceleration *)_poAcceleration;
332 
333 @property (nonatomic, retain) EAGLContext *poMainContext;
334 @property (nonatomic, retain) EAGLContext *poThreadContext;
335 @property BOOL bShaderSupport;
336 @property BOOL bCompressedTextureSupport;
337 
338 @end
339 
340 #endif /* __orxIOS__ && __orxOBJC__ */
341 
342 
345 extern orxDLLAPI void orxFASTCALL orxDisplay_Setup();
346 
354 static orxINLINE orxRGBA orxRGBA_Set(orxU8 _u8R, orxU8 _u8G, orxU8 _u8B, orxU8 _u8A)
355 {
356  orxRGBA stResult;
357 
358  /* Updates result */
359  stResult.u8R = _u8R;
360  stResult.u8G = _u8G;
361  stResult.u8B = _u8B;
362  stResult.u8A = _u8A;
363 
364  /* Done! */
365  return stResult;
366 }
367 
368 
374 static orxINLINE orxCOLOR * orxColor_SetRGBA(orxCOLOR *_pstColor, orxRGBA _stRGBA)
375 {
376  orxCOLOR *pstResult = _pstColor;
377 
378  /* Checks */
379  orxASSERT(_pstColor != orxNULL);
380 
381  /* Stores RGB */
383 
384  /* Stores alpha */
385  _pstColor->fAlpha = orxCOLOR_NORMALIZER * orxRGBA_A(_stRGBA);
386 
387  /* Done! */
388  return pstResult;
389 }
390 
397 static orxINLINE orxCOLOR * orxColor_Set(orxCOLOR *_pstColor, const orxVECTOR *_pvRGB, orxFLOAT _fAlpha)
398 {
399  orxCOLOR *pstResult = _pstColor;
400 
401  /* Checks */
402  orxASSERT(_pstColor != orxNULL);
403 
404  /* Stores RGB */
405  orxVector_Copy(&(_pstColor->vRGB), _pvRGB);
406 
407  /* Stores alpha */
408  _pstColor->fAlpha = _fAlpha;
409 
410  /* Done! */
411  return pstResult;
412 }
413 
419 static orxINLINE orxCOLOR * orxColor_SetRGB(orxCOLOR *_pstColor, const orxVECTOR *_pvRGB)
420 {
421  orxCOLOR *pstResult = _pstColor;
422 
423  /* Checks */
424  orxASSERT(_pstColor != orxNULL);
425  orxASSERT(_pvRGB != orxNULL);
426 
427  /* Stores components */
428  orxVector_Copy(&(_pstColor->vRGB), _pvRGB);
429 
430  /* Done! */
431  return pstResult;
432 }
433 
439 static orxINLINE orxCOLOR * orxColor_SetAlpha(orxCOLOR *_pstColor, orxFLOAT _fAlpha)
440 {
441  orxCOLOR *pstResult = _pstColor;
442 
443  /* Checks */
444  orxASSERT(_pstColor != orxNULL);
445 
446  /* Stores it */
447  _pstColor->fAlpha = _fAlpha;
448 
449  /* Done! */
450  return pstResult;
451 }
452 
457 static orxINLINE orxRGBA orxColor_ToRGBA(const orxCOLOR *_pstColor)
458 {
459  orxRGBA stResult;
460  orxVECTOR vColor;
461  orxFLOAT fAlpha;
462 
463  /* Checks */
464  orxASSERT(_pstColor != orxNULL);
465 
466  /* Clamps RGB components */
467  orxVector_Clamp(&vColor, &(_pstColor->vRGB), &orxVECTOR_BLACK, &orxVECTOR_WHITE);
468 
469  /* De-normalizes vector */
470  orxVector_Mulf(&vColor, &vColor, orxCOLOR_DENORMALIZER);
471 
472  /* Clamps alpha */
473  fAlpha = orxCLAMP(_pstColor->fAlpha, orxFLOAT_0, orxFLOAT_1);
474 
475  /* Updates result */
476  stResult = orx2RGBA(orxF2U(vColor.fR), orxF2U(vColor.fG), orxF2U(vColor.fB), orxF2U(orxCOLOR_DENORMALIZER * fAlpha));
477 
478  /* Done! */
479  return stResult;
480 }
481 
487 static orxINLINE orxCOLOR * orxColor_Copy(orxCOLOR *_pstDst, const orxCOLOR *_pstSrc)
488 {
489  /* Checks */
490  orxASSERT(_pstDst != orxNULL);
491  orxASSERT(_pstSrc != orxNULL);
492 
493  /* Copies it */
494  orxMemory_Copy(_pstDst, _pstSrc, sizeof(orxCOLOR));
495 
496  /* Done! */
497  return _pstDst;
498 }
499 
505 static orxCOLOR *orxFASTCALL orxColor_FromRGBToHSL(orxCOLOR *_pstDst, const orxCOLOR *_pstSrc)
506 {
507  orxCOLOR *pstResult = _pstDst;
508  orxFLOAT fMin, fMax, fDelta, fR, fG, fB;
509 
510  /* Checks */
511  orxASSERT(_pstDst != orxNULL);
512  orxASSERT(_pstSrc != orxNULL);
513 
514  /* Gets source red, blue and green components */
515  fR = _pstSrc->vRGB.fR;
516  fG = _pstSrc->vRGB.fG;
517  fB = _pstSrc->vRGB.fB;
518 
519  /* Gets min, max & delta values */
520  fMin = orxMIN(fR, orxMIN(fG, fB));
521  fMax = orxMAX(fR, orxMAX(fG, fB));
522  fDelta = fMax - fMin;
523 
524  /* Stores lightness */
525  pstResult->vHSL.fL = orx2F(0.5f) * (fMax + fMin);
526 
527  /* Gray? */
528  if(fDelta == orxFLOAT_0)
529  {
530  /* Gets hue & saturation */
531  pstResult->vHSL.fH = pstResult->vHSL.fS = orxFLOAT_0;
532  }
533  else
534  {
535  /* Updates saturation */
536  pstResult->vHSL.fS = (pstResult->vHSL.fL < orx2F(0.5f))
537  ? fDelta / (fMax + fMin)
538  : fDelta / (orx2F(2.0f) - fMax - fMin);
539 
540  /* Red tone? */
541  if(fR == fMax)
542  {
543  /* Updates hue */
544  pstResult->vHSL.fH = orx2F(1.0f / 6.0f) * (fG - fB) / fDelta;
545  }
546  /* Green tone? */
547  else if(fG == fMax)
548  {
549  /* Updates hue */
550  pstResult->vHSL.fH = orx2F(1.0f / 3.0f) + (orx2F(1.0f / 6.0f) * (fB - fR) / fDelta);
551  }
552  /* Blue tone */
553  else
554  {
555  /* Updates hue */
556  pstResult->vHSL.fH = orx2F(2.0f / 3.0f) + (orx2F(1.0f / 6.0f) * (fR - fG) / fDelta);
557  }
558 
559  /* Clamps hue */
560  if(pstResult->vHSL.fH < orxFLOAT_0)
561  {
562  pstResult->vHSL.fH += orxFLOAT_1;
563  }
564  else if(pstResult->vHSL.fH > orxFLOAT_1)
565  {
566  pstResult->vHSL.fH -= orxFLOAT_1;
567  }
568  }
569 
570  /* Updates alpha */
571  pstResult->fAlpha = _pstSrc->fAlpha;
572 
573  /* Done! */
574  return pstResult;
575 }
576 
582 static orxCOLOR *orxFASTCALL orxColor_FromHSLToRGB(orxCOLOR *_pstDst, const orxCOLOR *_pstSrc)
583 {
584  orxCOLOR *pstResult = _pstDst;
585  orxFLOAT fH, fS, fL;
586 
587 #define orxCOLOR_GET_RGB_COMPONENT(RESULT, ALT, CHROMA, HUE) \
588 do \
589 { \
590  if(HUE < orx2F(1.0f / 6.0f)) \
591  { \
592  RESULT = ALT + (orx2F(6.0f) * HUE * (CHROMA - ALT)); \
593  } \
594  else if(HUE < orx2F(1.0f / 2.0f)) \
595  { \
596  RESULT = CHROMA; \
597  } \
598  else if(HUE < orx2F(2.0f / 3.0f)) \
599  { \
600  RESULT = ALT + (orx2F(6.0f) * (CHROMA - ALT) * (orx2F(2.0f / 3.0f) - HUE)); \
601  } \
602  else \
603  { \
604  RESULT = ALT; \
605  } \
606  if(RESULT < orxMATH_KF_EPSILON) \
607  { \
608  RESULT = orxFLOAT_0; \
609  } \
610  else if(RESULT > orxFLOAT_1 - orxMATH_KF_EPSILON) \
611  { \
612  RESULT = orxFLOAT_1; \
613  } \
614 } \
615 while(orxFALSE)
616 
617  /* Checks */
618  orxASSERT(_pstDst != orxNULL);
619  orxASSERT(_pstSrc != orxNULL);
620 
621  /* Gets source hue, saturation and lightness components */
622  fH = _pstSrc->vRGB.fH;
623  fS = _pstSrc->vRGB.fS;
624  fL = _pstSrc->vRGB.fL;
625 
626  /* Gray? */
627  if(fS == orxFLOAT_0)
628  {
629  /* Updates result */
630  orxVector_SetAll(&(pstResult->vRGB), fL);
631  }
632  else
633  {
634  orxFLOAT fChroma, fIntermediate;
635 
636  /* Gets chroma */
637  fChroma = (fL < orx2F(0.5f))
638  ? fL + (fL * fS)
639  : fL + fS - (fL * fS);
640 
641  /* Gets intermediate value */
642  fIntermediate = (orx2F(2.0f) * fL) - fChroma;
643 
644  /* Gets RGB components */
645  if(fH > orx2F(2.0f / 3.0f))
646  {
647  orxCOLOR_GET_RGB_COMPONENT(pstResult->vRGB.fR, fIntermediate, fChroma, (fH - orx2F(2.0f / 3.0f)));
648  }
649  else
650  {
651  orxCOLOR_GET_RGB_COMPONENT(pstResult->vRGB.fR, fIntermediate, fChroma, (fH + orx2F(1.0f / 3.0f)));
652  }
653  orxCOLOR_GET_RGB_COMPONENT(pstResult->vRGB.fG, fIntermediate, fChroma, fH);
654  if(fH < orx2F(1.0f / 3.0f))
655  {
656  orxCOLOR_GET_RGB_COMPONENT(pstResult->vRGB.fB, fIntermediate, fChroma, (fH + orx2F(2.0f / 3.0f)));
657  }
658  else
659  {
660  orxCOLOR_GET_RGB_COMPONENT(pstResult->vRGB.fB, fIntermediate, fChroma, (fH - orx2F(1.0f / 3.0f)));
661  }
662  }
663 
664  /* Updates alpha */
665  pstResult->fAlpha = _pstSrc->fAlpha;
666 
667  /* Done! */
668  return pstResult;
669 }
670 
676 static orxCOLOR *orxFASTCALL orxColor_FromRGBToHSV(orxCOLOR *_pstDst, const orxCOLOR *_pstSrc)
677 {
678  orxCOLOR *pstResult = _pstDst;
679  orxFLOAT fMin, fMax, fDelta, fR, fG, fB;
680 
681  /* Checks */
682  orxASSERT(_pstDst != orxNULL);
683  orxASSERT(_pstSrc != orxNULL);
684 
685  /* Gets source red, blue and green components */
686  fR = _pstSrc->vRGB.fR;
687  fG = _pstSrc->vRGB.fG;
688  fB = _pstSrc->vRGB.fB;
689 
690  /* Gets min, max & delta values */
691  fMin = orxMIN(fR, orxMIN(fG, fB));
692  fMax = orxMAX(fR, orxMAX(fG, fB));
693  fDelta = fMax - fMin;
694 
695  /* Stores value */
696  pstResult->vHSL.fV = fMax;
697 
698  /* Gray? */
699  if(fDelta == orxFLOAT_0)
700  {
701  /* Gets hue & saturation */
702  pstResult->vHSL.fH = pstResult->vHSL.fS = orxFLOAT_0;
703  }
704  else
705  {
706  /* Updates saturation */
707  pstResult->vHSL.fS = fDelta / fMax;
708 
709  /* Red tone? */
710  if(fR == fMax)
711  {
712  /* Updates hue */
713  pstResult->vHSL.fH = orx2F(1.0f / 6.0f) * (fG - fB) / fDelta;
714  }
715  /* Green tone? */
716  else if(fG == fMax)
717  {
718  /* Updates hue */
719  pstResult->vHSL.fH = orx2F(1.0f / 3.0f) + (orx2F(1.0f / 6.0f) * (fB - fR) / fDelta);
720  }
721  /* Blue tone */
722  else
723  {
724  /* Updates hue */
725  pstResult->vHSL.fH = orx2F(2.0f / 3.0f) + (orx2F(1.0f / 6.0f) * (fR - fG) / fDelta);
726  }
727 
728  /* Clamps hue */
729  if(pstResult->vHSL.fH < orxFLOAT_0)
730  {
731  pstResult->vHSL.fH += orxFLOAT_1;
732  }
733  else if(pstResult->vHSL.fH > orxFLOAT_1)
734  {
735  pstResult->vHSL.fH -= orxFLOAT_1;
736  }
737  }
738 
739  /* Updates alpha */
740  pstResult->fAlpha = _pstSrc->fAlpha;
741 
742  /* Done! */
743  return pstResult;
744 }
745 
751 static orxCOLOR *orxFASTCALL orxColor_FromHSVToRGB(orxCOLOR *_pstDst, const orxCOLOR *_pstSrc)
752 {
753  orxCOLOR *pstResult = _pstDst;
754  orxFLOAT fH, fS, fV;
755 
756  /* Checks */
757  orxASSERT(_pstDst != orxNULL);
758  orxASSERT(_pstSrc != orxNULL);
759 
760  /* Gets source hue, saturation and value components */
761  fH = _pstSrc->vRGB.fH;
762  fS = _pstSrc->vRGB.fS;
763  fV = _pstSrc->vRGB.fV;
764 
765  /* Gray? */
766  if(fS == orxFLOAT_0)
767  {
768  /* Updates result */
769  orxVector_SetAll(&(pstResult->vRGB), fV);
770  }
771  else
772  {
773  orxFLOAT fFullHue, fSector, fIntermediate;
774 
775  /* Gets intermediate value */
776  fIntermediate = fV * fS;
777 
778  /* Gets full hue & sector */
779  fFullHue = orx2F(6.0f) * fH;
780  fSector = orxMath_Floor(fFullHue);
781 
782  /* Depending on sector */
783  switch(orxF2U(fSector))
784  {
785  default:
786  case 0:
787  {
788  /* Updates RGB components */
789  pstResult->vRGB.fR = fV;
790  pstResult->vRGB.fG = fV - (fIntermediate - (fIntermediate * (fFullHue - fSector)));
791  pstResult->vRGB.fB = fV - fIntermediate;
792 
793  break;
794  }
795 
796  case 1:
797  {
798  /* Updates RGB components */
799  pstResult->vRGB.fR = fV - (fIntermediate * (fFullHue - fSector));
800  pstResult->vRGB.fG = fV;
801  pstResult->vRGB.fB = fV - fIntermediate;
802 
803  break;
804  }
805 
806  case 2:
807  {
808  /* Updates RGB components */
809  pstResult->vRGB.fR = fV - fIntermediate;
810  pstResult->vRGB.fG = fV;
811  pstResult->vRGB.fB = fV - (fIntermediate - (fIntermediate * (fFullHue - fSector)));
812 
813  break;
814  }
815 
816  case 3:
817  {
818  /* Updates RGB components */
819  pstResult->vRGB.fR = fV - fIntermediate;
820  pstResult->vRGB.fG = fV - (fIntermediate * (fFullHue - fSector));
821  pstResult->vRGB.fB = fV;
822 
823  break;
824  }
825 
826  case 4:
827  {
828  /* Updates RGB components */
829  pstResult->vRGB.fR = fV - (fIntermediate - (fIntermediate * (fFullHue - fSector)));
830  pstResult->vRGB.fG = fV - fIntermediate;
831  pstResult->vRGB.fB = fV;
832 
833  break;
834  }
835 
836  case 5:
837  {
838  /* Updates RGB components */
839  pstResult->vRGB.fR = fV;
840  pstResult->vRGB.fG = fV - fIntermediate;
841  pstResult->vRGB.fB = fV - (fIntermediate * (fFullHue - fSector));
842 
843  break;
844  }
845  }
846  }
847 
848  /* Updates alpha */
849  pstResult->fAlpha = _pstSrc->fAlpha;
850 
851  /* Done! */
852  return pstResult;
853 }
854 
859 extern orxDLLAPI orxDISPLAY_BLEND_MODE orxFASTCALL orxDisplay_GetBlendModeFromString(const orxSTRING _zBlendMode);
860 
861 
862 /***************************************************************************
863  * Functions extended by plugins
864  ***************************************************************************/
865 
869 extern orxDLLAPI orxSTATUS orxFASTCALL orxDisplay_Init();
870 
873 extern orxDLLAPI void orxFASTCALL orxDisplay_Exit();
874 
875 
879 extern orxDLLAPI orxSTATUS orxFASTCALL orxDisplay_Swap();
880 
881 
885 extern orxDLLAPI orxBITMAP *orxFASTCALL orxDisplay_GetScreenBitmap();
886 
892 extern orxDLLAPI orxSTATUS orxFASTCALL orxDisplay_GetScreenSize(orxFLOAT *_pfWidth, orxFLOAT *_pfHeight);
893 
894 
900 extern orxDLLAPI orxBITMAP *orxFASTCALL orxDisplay_CreateBitmap(orxU32 _u32Width, orxU32 _u32Height);
901 
905 extern orxDLLAPI void orxFASTCALL orxDisplay_DeleteBitmap(orxBITMAP *_pstBitmap);
906 
907 
912 extern orxDLLAPI orxBITMAP *orxFASTCALL orxDisplay_LoadBitmap(const orxSTRING _zFileName);
913 
919 extern orxDLLAPI orxSTATUS orxFASTCALL orxDisplay_SaveBitmap(const orxBITMAP *_pstBitmap, const orxSTRING _zFileName);
920 
921 
926 extern orxDLLAPI orxSTATUS orxFASTCALL orxDisplay_SetTempBitmap(const orxBITMAP *_pstBitmap);
927 
931 extern orxDLLAPI const orxBITMAP *orxFASTCALL orxDisplay_GetTempBitmap();
932 
933 
939 extern orxDLLAPI orxSTATUS orxFASTCALL orxDisplay_SetDestinationBitmaps(orxBITMAP **_apstBitmapList, orxU32 _u32Number);
940 
946 extern orxDLLAPI orxSTATUS orxFASTCALL orxDisplay_ClearBitmap(orxBITMAP *_pstBitmap, orxRGBA _stColor);
947 
952 extern orxDLLAPI orxSTATUS orxFASTCALL orxDisplay_SetBlendMode(orxDISPLAY_BLEND_MODE _eBlendMode);
953 
962 extern orxDLLAPI orxSTATUS orxFASTCALL orxDisplay_SetBitmapClipping(orxBITMAP *_pstBitmap, orxU32 _u32TLX, orxU32 _u32TLY, orxU32 _u32BRX, orxU32 _u32BRY);
963 
970 extern orxDLLAPI orxSTATUS orxFASTCALL orxDisplay_SetBitmapData(orxBITMAP *_pstBitmap, const orxU8 *_au8Data, orxU32 _u32ByteNumber);
971 
978 extern orxDLLAPI orxSTATUS orxFASTCALL orxDisplay_GetBitmapData(const orxBITMAP *_pstBitmap, orxU8 *_au8Data, orxU32 _u32ByteNumber);
979 
989 extern orxDLLAPI orxSTATUS orxFASTCALL orxDisplay_SetPartialBitmapData(orxBITMAP *_pstBitmap, const orxU8 *_au8Data, orxU32 _u32X, orxU32 _u32Y, orxU32 _u32Width, orxU32 _u32Height);
990 
997 extern orxDLLAPI orxSTATUS orxFASTCALL orxDisplay_GetBitmapSize(const orxBITMAP *_pstBitmap, orxFLOAT *_pfWidth, orxFLOAT *_pfHeight);
998 
999 
1004 extern orxDLLAPI orxU32 orxFASTCALL orxDisplay_GetBitmapID(const orxBITMAP *_pstBitmap);
1005 
1014 extern orxDLLAPI orxSTATUS orxFASTCALL orxDisplay_TransformBitmap(const orxBITMAP *_pstSrc, const orxDISPLAY_TRANSFORM *_pstTransform, orxRGBA _stColor, orxDISPLAY_SMOOTHING _eSmoothing, orxDISPLAY_BLEND_MODE _eBlendMode);
1015 
1026 extern orxDLLAPI orxSTATUS orxFASTCALL orxDisplay_TransformText(const orxSTRING _zString, const orxBITMAP *_pstFont, const orxCHARACTER_MAP *_pstMap, const orxDISPLAY_TRANSFORM *_pstTransform, orxRGBA _stColor, orxDISPLAY_SMOOTHING _eSmoothing, orxDISPLAY_BLEND_MODE _eBlendMode);
1027 
1028 
1035 extern orxDLLAPI orxSTATUS orxFASTCALL orxDisplay_DrawLine(const orxVECTOR *_pvStart, const orxVECTOR *_pvEnd, orxRGBA _stColor);
1036 
1043 extern orxDLLAPI orxSTATUS orxFASTCALL orxDisplay_DrawPolyline(const orxVECTOR *_avVertexList, orxU32 _u32VertexNumber, orxRGBA _stColor);
1044 
1052 extern orxDLLAPI orxSTATUS orxFASTCALL orxDisplay_DrawPolygon(const orxVECTOR *_avVertexList, orxU32 _u32VertexNumber, orxRGBA _stColor, orxBOOL _bFill);
1053 
1061 extern orxDLLAPI orxSTATUS orxFASTCALL orxDisplay_DrawCircle(const orxVECTOR *_pvCenter, orxFLOAT _fRadius, orxRGBA _stColor, orxBOOL _bFill);
1062 
1069 extern orxDLLAPI orxSTATUS orxFASTCALL orxDisplay_DrawOBox(const orxOBOX *_pstBox, orxRGBA _stColor, orxBOOL _bFill);
1070 
1078 extern orxDLLAPI orxSTATUS orxFASTCALL orxDisplay_DrawMesh(const orxDISPLAY_MESH *_pstMesh, const orxBITMAP *_pstBitmap, orxDISPLAY_SMOOTHING _eSmoothing, orxDISPLAY_BLEND_MODE _eBlendMode);
1079 
1083 extern orxDLLAPI orxBOOL orxFASTCALL orxDisplay_HasShaderSupport();
1084 
1092 extern orxDLLAPI orxHANDLE orxFASTCALL orxDisplay_CreateShader(const orxSTRING *_azCodeList, orxU32 _u32Size, const orxLINKLIST *_pstParamList, orxBOOL _bUseCustomParam);
1093 
1097 extern orxDLLAPI void orxFASTCALL orxDisplay_DeleteShader(orxHANDLE _hShader);
1098 
1103 extern orxDLLAPI orxSTATUS orxFASTCALL orxDisplay_StartShader(const orxHANDLE _hShader);
1104 
1109 extern orxDLLAPI orxSTATUS orxFASTCALL orxDisplay_StopShader(const orxHANDLE _hShader);
1110 
1118 extern orxDLLAPI orxS32 orxFASTCALL orxDisplay_GetParameterID(orxHANDLE _hShader, const orxSTRING _zParam, orxS32 _s32Index, orxBOOL _bIsTexture);
1119 
1126 extern orxDLLAPI orxSTATUS orxFASTCALL orxDisplay_SetShaderBitmap(orxHANDLE _hShader, orxS32 _s32ID, const orxBITMAP *_pstValue);
1127 
1134 extern orxDLLAPI orxSTATUS orxFASTCALL orxDisplay_SetShaderFloat(orxHANDLE _hShader, orxS32 _s32ID, orxFLOAT _fValue);
1135 
1142 extern orxDLLAPI orxSTATUS orxFASTCALL orxDisplay_SetShaderVector(orxHANDLE _hShader, orxS32 _s32ID, const orxVECTOR *_pvValue);
1143 
1144 
1149 extern orxDLLAPI orxSTATUS orxFASTCALL orxDisplay_EnableVSync(orxBOOL _bEnable);
1150 
1154 extern orxDLLAPI orxBOOL orxFASTCALL orxDisplay_IsVSyncEnabled();
1155 
1156 
1161 extern orxDLLAPI orxSTATUS orxFASTCALL orxDisplay_SetFullScreen(orxBOOL _bFullScreen);
1162 
1166 extern orxDLLAPI orxBOOL orxFASTCALL orxDisplay_IsFullScreen();
1167 
1168 
1172 extern orxDLLAPI orxU32 orxFASTCALL orxDisplay_GetVideoModeCount();
1173 
1179 extern orxDLLAPI orxDISPLAY_VIDEO_MODE *orxFASTCALL orxDisplay_GetVideoMode(orxU32 _u32Index, orxDISPLAY_VIDEO_MODE *_pstVideoMode);
1180 
1185 extern orxDLLAPI orxSTATUS orxFASTCALL orxDisplay_SetVideoMode(const orxDISPLAY_VIDEO_MODE *_pstVideoMode);
1186 
1191 extern orxDLLAPI orxBOOL orxFASTCALL orxDisplay_IsVideoModeAvailable(const orxDISPLAY_VIDEO_MODE *_pstVideoMode);
1192 
1193 
1194 #endif /* _orxDISPLAY_H_ */
1195 
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:167
orxFLOAT fB
Definition: orxVector.h:87
static orxINLINE orxVECTOR * orxVector_Mulf(orxVECTOR *_pvRes, const orxVECTOR *_pvOp1, orxFLOAT _fOp2)
Definition: orxVector.h:198
static orxCOLOR *orxFASTCALL orxColor_FromHSVToRGB(orxCOLOR *_pstDst, const orxCOLOR *_pstSrc)
Definition: orxDisplay.h:751
orxDISPLAY_EVENT
Definition: orxDisplay.h:250
orxVECTOR vHSV
Definition: orxDisplay.h:202
orxDLLAPI orxSTATUS orxFASTCALL orxDisplay_DrawMesh(const orxDISPLAY_MESH *_pstMesh, const orxBITMAP *_pstBitmap, orxDISPLAY_SMOOTHING _eSmoothing, orxDISPLAY_BLEND_MODE _eBlendMode)
orxU32 u32VertexNumber
Definition: orxDisplay.h:131
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
orxDLLAPI const orxVECTOR orxVECTOR_BLACK
#define orxF2U(V)
Definition: orxMath.h:95
orxDLLAPI orxSTATUS orxFASTCALL orxDisplay_SetShaderVector(orxHANDLE _hShader, orxS32 _s32ID, const orxVECTOR *_pvValue)
orxDLLAPI void orxFASTCALL orxDisplay_DeleteShader(orxHANDLE _hShader)
static const orxFLOAT orxFLOAT_1
Definition: orxType.h:193
orxDLLAPI orxBOOL orxFASTCALL orxDisplay_IsFullScreen()
static orxINLINE orxRGBA orxColor_ToRGBA(const orxCOLOR *_pstColor)
Definition: orxDisplay.h:457
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:74
orxDLLAPI void orxFASTCALL orxDisplay_Setup()
orxFLOAT fAlpha
Definition: orxDisplay.h:204
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)
orxDLLAPI orxU32 orxFASTCALL orxDisplay_GetVideoModeCount()
#define orxCLAMP(V, MIN, MAX)
Definition: orxMath.h:89
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:505
static orxCOLOR *orxFASTCALL orxColor_FromRGBToHSV(orxCOLOR *_pstDst, const orxCOLOR *_pstSrc)
Definition: orxDisplay.h:676
static orxINLINE orxCOLOR * orxColor_SetRGB(orxCOLOR *_pstColor, const orxVECTOR *_pvRGB)
Definition: orxDisplay.h:419
orxDLLAPI orxU32 orxFASTCALL orxDisplay_GetBitmapID(const orxBITMAP *_pstBitmap)
orxSTRINGID stFilenameID
Definition: orxDisplay.h:284
orxFLOAT fS
Definition: orxVector.h:80
static orxINLINE orxFLOAT orxMath_Floor(orxFLOAT _fOp)
Definition: orxMath.h:514
orxDLLAPI orxSTATUS orxFASTCALL orxDisplay_SaveBitmap(const orxBITMAP *_pstBitmap, const orxSTRING _zFileName)
static orxINLINE orxVECTOR * orxVector_Set(orxVECTOR *_pvVec, orxFLOAT _fX, orxFLOAT _fY, orxFLOAT _fZ)
Definition: orxVector.h:105
orxDLLAPI orxSTATUS orxFASTCALL orxDisplay_Swap()
orxHASHTABLE * pstCharacterTable
Definition: orxDisplay.h:161
#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:582
orxBANK * pstCharacterBank
Definition: orxDisplay.h:160
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)
orxDISPLAY_PRIMITIVE ePrimitive
Definition: orxDisplay.h:133
#define orxCOLOR_NORMALIZER
Definition: orxDisplay.h:79
const orxDISPLAY_VERTEX * astVertexList
Definition: orxDisplay.h:129
#define orxU2F(V)
Definition: orxMath.h:107
static orxINLINE orxCOLOR * orxColor_Set(orxCOLOR *_pstColor, const orxVECTOR *_pvRGB, orxFLOAT _fAlpha)
Definition: orxDisplay.h:397
orxFLOAT fG
Definition: orxVector.h:79
#define orxMAX(A, B)
Definition: orxMath.h:81
orxU32 u32IndexNumber
Definition: orxDisplay.h:132
static orxINLINE orxVECTOR * orxVector_Clamp(orxVECTOR *_pvRes, const orxVECTOR *_pvOp, const orxVECTOR *_pvMin, const orxVECTOR *_pvMax)
Definition: orxVector.h:359
orxVECTOR vHSL
Definition: orxDisplay.h:201
orxDLLAPI orxSTATUS orxFASTCALL orxDisplay_SetBlendMode(orxDISPLAY_BLEND_MODE _eBlendMode)
orxDLLAPI orxSTATUS orxFASTCALL orxDisplay_TransformText(const orxSTRING _zString, const orxBITMAP *_pstFont, const orxCHARACTER_MAP *_pstMap, const orxDISPLAY_TRANSFORM *_pstTransform, orxRGBA _stColor, orxDISPLAY_SMOOTHING _eSmoothing, 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:200
orxFLOAT fR
Definition: orxVector.h:71
orxSTATUS
Definition: orxType.h:246
orxDISPLAY_PRIMITIVE
Definition: orxDisplay.h:109
orxDLLAPI orxS32 orxFASTCALL orxDisplay_GetParameterID(orxHANDLE _hShader, const orxSTRING _zParam, orxS32 _s32Index, orxBOOL _bIsTexture)
orxDLLAPI orxBITMAP *orxFASTCALL orxDisplay_LoadBitmap(const orxSTRING _zFileName)
const orxU16 * au16IndexList
Definition: orxDisplay.h:130
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:374
#define orxDLLAPI
Definition: orxDecl.h:381
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:354
orxFLOAT fV
Definition: orxVector.h:89
orxDLLAPI orxSTATUS orxFASTCALL orxDisplay_DrawCircle(const orxVECTOR *_pvCenter, orxFLOAT _fRadius, orxRGBA _stColor, orxBOOL _bFill)
orxDISPLAY_BLEND_MODE
Definition: orxDisplay.h:181
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:124
orxDLLAPI orxSTATUS orxFASTCALL orxDisplay_SetPartialBitmapData(orxBITMAP *_pstBitmap, const orxU8 *_au8Data, orxU32 _u32X, orxU32 _u32Y, orxU32 _u32Width, orxU32 _u32Height)
orxU8 u8A
Definition: orxDisplay.h:65
orxDLLAPI const orxVECTOR orxVECTOR_WHITE
static const orxFLOAT orxFLOAT_0
Definition: orxType.h:192
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 orxBOOL orxFASTCALL orxDisplay_HasShaderSupport()
orxDLLAPI orxBOOL orxFASTCALL orxDisplay_IsVideoModeAvailable(const orxDISPLAY_VIDEO_MODE *_pstVideoMode)
orxFLOAT fCharacterHeight
Definition: orxDisplay.h:158
static orxINLINE void * orxMemory_Copy(void *_pDest, const void *_pSrc, orxU32 _u32Size)
Definition: orxMemory.h:148
orxDLLAPI orxSTATUS orxFASTCALL orxDisplay_SetTempBitmap(const orxBITMAP *_pstBitmap)
static orxINLINE orxCOLOR * orxColor_Copy(orxCOLOR *_pstDst, const orxCOLOR *_pstSrc)
Definition: orxDisplay.h:487
orxFLOAT fL
Definition: orxVector.h:88
#define orxASSERT(TEST,...)
Definition: orxDebug.h:353
orxDLLAPI orxSTATUS orxFASTCALL orxDisplay_TransformBitmap(const orxBITMAP *_pstSrc, const orxDISPLAY_TRANSFORM *_pstTransform, orxRGBA _stColor, orxDISPLAY_SMOOTHING _eSmoothing, orxDISPLAY_BLEND_MODE _eBlendMode)
static orxINLINE orxCOLOR * orxColor_SetAlpha(orxCOLOR *_pstColor, orxFLOAT _fAlpha)
Definition: orxDisplay.h:439
orxDLLAPI void orxFASTCALL orxDisplay_DeleteBitmap(orxBITMAP *_pstBitmap)
static orxINLINE orxVECTOR * orxVector_Copy(orxVECTOR *_pvDst, const orxVECTOR *_pvSrc)
Definition: orxVector.h:135
const orxSTRING zLocation
Definition: orxDisplay.h:283
orxDLLAPI orxSTATUS orxFASTCALL orxDisplay_DrawPolyline(const orxVECTOR *_avVertexList, orxU32 _u32VertexNumber, orxRGBA _stColor)
orxFLOAT fH
Definition: orxVector.h:72
orxDLLAPI orxDISPLAY_BLEND_MODE orxFASTCALL orxDisplay_GetBlendModeFromString(const orxSTRING _zBlendMode)
orxDLLAPI void orxFASTCALL orxDisplay_Exit()

Generated for orx by doxygen 1.8.11