Alpha Engine: AEGraphics.h Source File

AlphaEngine

AEGraphics.h
Go to the documentation of this file.
1 /******************************************************************************/
15 /******************************************************************************/
16 
17 #ifndef AE_GRAPHICS_H
18 #define AE_GRAPHICS_H
19 
20 // ---------------------------------------------------------------------------
21 // Defines
22 
24 typedef enum
25 {
29 
32 
33 
34 // ---------------------------------------------------------------------------
35 
37 typedef enum
38 {
42 
45 
46 // ---------------------------------------------------------------------------
47 
48 typedef enum
49 {
53 
54 // ---------------------------------------------------------------------------
55 
56 typedef enum
57 {
62 
63  // Keep this one last
66 
67 // ---------------------------------------------------------------------------
68 // Struct/Class definitions
69 
71 
72 typedef struct AEGfxVertexList
73 {
77 
78 // ---------------------------------------------------------------------------
79 
80 typedef struct AEGfxSurface AEGfxSurface;
81 
82 typedef struct AEGfxTexture
83 {
85  s8 mpName[256];
87 
88 // ---------------------------------------------------------------------------
89 // Extern variables
90 
91 // ---------------------------------------------------------------------------
92 // Function prototypes
93 // ---------------------------------------------------------------------------
94 
95 #ifdef __cplusplus
96 
97 extern "C"
98 {
99 #endif
100 
101 // ---------------------------------------------------------------------------
102 
103 /******************************************************************************/
122 /******************************************************************************/
123 AE_API s32 AEGfxInit(s32 Width, s32 Height);
124 DECLARE_FUNCTION_FOR_ANDROID_2_INT(AEGfxInit, s32 Width, s32 Height);
125 
126 /******************************************************************************/
137 /******************************************************************************/
138 AE_API void AEGfxReset();
139 
140 /******************************************************************************/
151 /******************************************************************************/
152 AE_API void AEGfxExit();
153 
154 /******************************************************************************/
165 /******************************************************************************/
166 AE_API void AEGfxStart();
167 DECLARE_FUNCTION_FOR_ANDROID(AEGfxStart);
168 
169 /******************************************************************************/
180 /******************************************************************************/
181 AE_API void AEGfxEnd();
183 
184 /******************************************************************************/
204 /******************************************************************************/
205 AE_API void AEGfxSetBackgroundColor(f32 Red, f32 Green, f32 Blue);
206 
207 /******************************************************************************/
223 /******************************************************************************/
224 AE_API void AEGfxSetRenderMode(AEGfxRenderMode RenderMode);
225 
226 /******************************************************************************/
238 /******************************************************************************/
239 AE_API void AEGfxSetBlendMode(AEGfxBlendMode BlendMode);
240 
241 /******************************************************************************/
250 /******************************************************************************/
252 
253 /******************************************************************************/
262 /******************************************************************************/
264 
265 /******************************************************************************/
274 /******************************************************************************/
276 
277 /******************************************************************************/
286 /******************************************************************************/
288 
289 /******************************************************************************/
304 /******************************************************************************/
305 AE_API void AEGfxSetCamPosition(f32 X, f32 Y);
306 
307 /******************************************************************************/
322 /******************************************************************************/
323 AE_API void AEGfxGetCamPosition(f32 *pX, f32 *pY);
324 
325 // Sets/Gets the camera distance, used to zoom in/out
326 //AE_API void AEGfxSetCamZoom(f32 Distance);
327 //AE_API f32 AEGfxGetCamZoom();
328 
329 /******************************************************************************/
344 /******************************************************************************/
345 AE_API void AEGfxSetPosition(f32 X, f32 Y);
346 
347 /******************************************************************************/
363 /******************************************************************************/
364 AE_API void AEGfxSetTransform(f32 pTransform[3][3]);
365 
366 /******************************************************************************/
381 /******************************************************************************/
382 AE_API void AEGfxSetTransform3D(f32 pTransform[4][4]);
383 
384 /******************************************************************************/
400 /******************************************************************************/
401 AE_API void AEGfxSetTransparency(f32 Alpha);
402 
403 /******************************************************************************/
429 /******************************************************************************/
430 AE_API void AEGfxSetBlendColor(f32 Red, f32 Green, f32 Blue, f32 Alpha);
431 
432 /******************************************************************************/
458 /******************************************************************************/
459 AE_API void AEGfxSetTintColor(float Red, float Green, float Blue, float Alpha);
460 
461 /******************************************************************************/
473 /******************************************************************************/
474 AE_API void AEGfxMeshStart ();
475 
476 /******************************************************************************/
536 /******************************************************************************/
537 AE_API void AEGfxTriAdd (f32 x0, f32 y0, u32 c0, f32 tu0, f32 tv0,
538  f32 x1, f32 y1, u32 c1, f32 tu1, f32 tv1,
539  f32 x2, f32 y2, u32 c2, f32 tu2, f32 tv2);
540 
541 /******************************************************************************/
571 /******************************************************************************/
572 AE_API void AEGfxVertexAdd (f32 x0, f32 y0, u32 c0, f32 tu0, f32 tv0);
573 
574 /******************************************************************************/
586 /******************************************************************************/
588 
589 /******************************************************************************/
608 /******************************************************************************/
609 AE_API void AEGfxMeshDraw (AEGfxVertexList* pVertexList, AEGfxMeshDrawMode MeshDrawMode);
610 
611 /******************************************************************************/
626 /******************************************************************************/
627 AE_API void AEGfxMeshFree (AEGfxVertexList* pVertexList);
628 
629 /******************************************************************************/
642 /******************************************************************************/
643 AE_API AEGfxTexture* AEGfxTextureLoad(const s8 *pFileName);
644 
645 /******************************************************************************/
666 /******************************************************************************/
667 AE_API void AEGfxTextureSet(AEGfxTexture *pTexture, f32 offset_x, f32 offset_y);
668 
669 /******************************************************************************/
681 /******************************************************************************/
682 AE_API void AEGfxTextureUnload(AEGfxTexture *pTexture);
683 
684 /******************************************************************************/
704 /******************************************************************************/
705 AE_API AEGfxTexture* AEGfxTextureLoadFromMemory(u8 *pColors, u32 Width, u32 Height);
706 
707 /******************************************************************************/
724 /******************************************************************************/
725 AE_API void AEGfxSaveTextureToFile(AEGfxTexture* pTexture, s8 *pFileName);
726 
727 /******************************************************************************/
739 /******************************************************************************/
741 
742 /******************************************************************************/
769 /******************************************************************************/
770 AE_API void AEGfxPoint (f32 x0, f32 y0, f32 z0, u32 c0);
771 
772 /******************************************************************************/
832 /******************************************************************************/
833 AE_API void AEGfxLine (f32 x0, f32 y0, f32 z0, f32 r0, f32 g0, f32 b0, f32 a0,
834  f32 x1, f32 y1, f32 z1, f32 r1, f32 g1, f32 b1, f32 a1);
835 
836 /******************************************************************************/
890 /******************************************************************************/
891 AE_API void AEGfxTri (f32 x0, f32 y0, f32 z0, u32 c0,
892  f32 x1, f32 y1, f32 z1, u32 c1,
893  f32 x2, f32 y2, f32 z2, u32 c2);
894 
895 /******************************************************************************/
962 /******************************************************************************/
963 AE_API void AEGfxQuad (f32 x0, f32 y0, f32 z0, u32 c0,
964  f32 x1, f32 y1, f32 z1, u32 c1,
965  f32 x2, f32 y2, f32 z2, u32 c2,
966  f32 x3, f32 y3, f32 z3, u32 c3);
967 
968 /******************************************************************************/
1012 /******************************************************************************/
1013 AE_API void AEGfxBox (f32 x0, f32 y0, f32 z0, f32 sizeX, f32 sizeY, f32 sizeZ, u32 c0, u32 c1);
1014 
1015 /******************************************************************************/
1059 /******************************************************************************/
1060 AE_API void AEGfxSphere (f32 x0, f32 y0, f32 z0,
1061  f32 radius, u32 c0, u32 c1,
1062  u32 division);
1063 
1064 /******************************************************************************/
1121 /******************************************************************************/
1122 AE_API void AEGfxCone (f32 x0, f32 y0, f32 z0,
1123  f32 x1, f32 y1, f32 z1,
1124  f32 radius, u32 c0, u32 c1, u32 division);
1125 
1126 /******************************************************************************/
1145 /******************************************************************************/
1146 AE_API void AEGfxAxis (f32 scale);
1147 
1148 /******************************************************************************/
1171 /******************************************************************************/
1172 AE_API u32 AEGfxColInterp (u32 c0, u32 c1, f32 t);
1173 
1174 /******************************************************************************/
1201 /******************************************************************************/
1202 AE_API void AEGfxPrint (s32 x, s32 y, u32 color, s8* pStr);
1203 
1204 // ---------------------------------------------------------------------------
1205 
1206 #ifdef __cplusplus
1207 }
1208 #endif
1209 
1210 // ---------------------------------------------------------------------------
1211 
1212 #endif // AE_GRAPHICS_H
1213 
void AEGfxMeshStart()
Instruct AEGraphics to start creating a new mesh.
void AEGfxAxis(f32 scale)
Draw a 3D axis on screen.
void AEGfxSetTintColor(float Red, float Green, float Blue, float Alpha)
Sets a color (RGBA) that will be used to tint the original material.
void AEGfxMeshFree(AEGfxVertexList *pVertexList)
Free the mesh.
s8 mpName[256]
Definition: AEGraphics.h:85
void AEGfxSaveTextureToFile(AEGfxTexture *pTexture, s8 *pFileName)
Save a texture from memory to file.
float f32
Definition: AETypes.h:31
void AEGfxVertexAdd(f32 x0, f32 y0, u32 c0, f32 tu0, f32 tv0)
Add a new point to the mesh.
void AEGfxReset()
Reset AEGraphics.
unsigned int u32
Definition: AETypes.h:28
Color rendering.
Definition: AEGraphics.h:27
u32 AEGfxColInterp(u32 c0, u32 c1, f32 t)
Get the interpolation between two colours (c0 and c1) at time interval t.
void AEGfxBox(f32 x0, f32 y0, f32 z0, f32 sizeX, f32 sizeY, f32 sizeZ, u32 c0, u32 c1)
Draw a 3D box on screen.
f32 AEGfxGetWinMinY(void)
Get the minimum Y world coordinate.
void AEGfxPrint(s32 x, s32 y, u32 color, s8 *pStr)
Render text onto the screen.
void AEGfxTriAdd(f32 x0, f32 y0, u32 c0, f32 tu0, f32 tv0, f32 x1, f32 y1, u32 c1, f32 tu1, f32 tv1, f32 x2, f32 y2, u32 c2, f32 tu2, f32 tv2)
Add a new triangle to the mesh.
Color blending.
Definition: AEGraphics.h:40
Texture rendering.
Definition: AEGraphics.h:28
AEGfxTextureMode
Definition: AEGraphics.h:48
void AEGfxExit()
Free AEGraphics.
void AEGfxSetTextureMode(AEGfxTextureMode TextureMode)
Set the texture mode.
AEGfxRenderMode
Definition: AEGraphics.h:24
AEGfxSurface * mpSurface
Definition: AEGraphics.h:84
AEGfxVertexList * AEGfxMeshEnd()
Instruct AEGraphics to end creating of new mesh.
void AEGfxSetBlendMode(AEGfxBlendMode BlendMode)
Set the blend mode.
f32 AEGfxGetWinMaxX(void)
Get the maximum X world coordinate.
f32 AEGfxGetWinMaxY(void)
Get the maximum Y world coordinate.
void AEGfxTextureSet(AEGfxTexture *pTexture, f32 offset_x, f32 offset_y)
Set a texture to be used for rendering.
void AEGfxCone(f32 x0, f32 y0, f32 z0, f32 x1, f32 y1, f32 z1, f32 radius, u32 c0, u32 c1, u32 division)
Draw a 3D cone on screen.
f32 AEGfxGetWinMinX(void)
Get the minimum X world coordinate.
struct AEGfxVertexBuffer AEGfxVertexBuffer
Definition: AEGraphics.h:70
No render.
Definition: AEGraphics.h:26
AEGfxBlendMode
Definition: AEGraphics.h:37
AEGfxTexture * AEGfxTextureLoadFromMemory(u8 *pColors, u32 Width, u32 Height)
Load a texture from data in memory.
struct AEGfxTexture AEGfxTexture
void AEGfxGetCamPosition(f32 *pX, f32 *pY)
Get the camera's X and Y position.
AEGfxVertexBuffer * mpVtxBuffer
Definition: AEGraphics.h:74
s32 AEGfxInit(s32 Width, s32 Height)
Initialize AEGraphics.
signed int s32
Definition: AETypes.h:27
char s8
Definition: AETypes.h:23
void AEGfxSetTransform(f32 pTransform[3][3])
Set the new global transformation matrix.
void AEGfxTextureUnload(AEGfxTexture *pTexture)
Unload a texture file from memory.
DECLARE_FUNCTION_FOR_ANDROID_2_INT(AEGfxInit, s32 Width, s32 Height)
struct AEGfxSurface AEGfxSurface
Definition: AEGraphics.h:80
void AEGfxMeshDraw(AEGfxVertexList *pVertexList, AEGfxMeshDrawMode MeshDrawMode)
Draw the mesh on screen.
Additive blending.
Definition: AEGraphics.h:41
#define AE_API
Definition: AEExport.h:53
void AEGfxTri(f32 x0, f32 y0, f32 z0, u32 c0, f32 x1, f32 y1, f32 z1, u32 c1, f32 x2, f32 y2, f32 z2, u32 c2)
Draw a triangle on screen.
void AEGfxSetPosition(f32 X, f32 Y)
Set the position (translation) to render from.
AEGfxTexture * AEGfxTextureLoad(const s8 *pFileName)
Load a texture file into memory.
#define DECLARE_FUNCTION_FOR_ANDROID(functionName)
Definition: AEExport.h:59
void AEGfxSetBackgroundColor(f32 Red, f32 Green, f32 Blue)
Set the background colour to selected RGB values.
void AEGfxPoint(f32 x0, f32 y0, f32 z0, u32 c0)
Draw a point on screen.
void AEGfxQuad(f32 x0, f32 y0, f32 z0, u32 c0, f32 x1, f32 y1, f32 z1, u32 c1, f32 x2, f32 y2, f32 z2, u32 c2, f32 x3, f32 y3, f32 z3, u32 c3)
Draw a rectangle on screen.
void AEGfxSetTransform3D(f32 pTransform[4][4])
Set the new global transformation matrix.
unsigned char u8
Definition: AETypes.h:24
AEGfxMeshDrawMode
Definition: AEGraphics.h:56
void AEGfxSetBlendColor(f32 Red, f32 Green, f32 Blue, f32 Alpha)
Sets a color (RGBA) that will be used to blend with the original material.
void AEGfxStart()
Tell AEGraphics that a new frame is starting.
void AEGfxSetRenderMode(AEGfxRenderMode RenderMode)
Set the render mode.
void AEGfxLine(f32 x0, f32 y0, f32 z0, f32 r0, f32 g0, f32 b0, f32 a0, f32 x1, f32 y1, f32 z1, f32 r1, f32 g1, f32 b1, f32 a1)
Draw a line on screen.
void AEGfxSetTransparency(f32 Alpha)
Set the new global transparency value.
No blending.
Definition: AEGraphics.h:39
struct AEGfxVertexList AEGfxVertexList
void AEGfxSphere(f32 x0, f32 y0, f32 z0, f32 radius, u32 c0, u32 c1, u32 division)
Draw a 3D sphere on screen.
void AEGfxEnd()
Tell AEGraphics that the current frame is ending.
void AEGfxSetCamPosition(f32 X, f32 Y)
Set the camera's X and Y position.
Generated on Sat Jan 4 2014 02:06:22 for Alpha Engine by   doxygen 1.8.5