My Project
RenderCore.h
1 #pragma once
2 #ifdef USE_DIRECTX_RENDERER
3 #include "common/dxstdafx.h"
4 #elif defined(USE_OPENGL_RENDERER)
5 #include "OpenGLWrapper.h"
6 #else
7 #include "PEtypes.h"
8 
9 #if (PARA_TARGET_PLATFORM == PARA_PLATFORM_MAC)
10  #include <OpenGL/gl.h>
11 #else
12  #include <GL/gl.h>
13 #endif
14 
15 #endif
16 
17 #ifdef WIN32
18 # ifndef _CRT_SECURE_NO_WARNINGS
19 # define _CRT_SECURE_NO_WARNINGS
20 # endif
21 #endif
22 
23 #include "PEtypes.h"
24 
25 #include "math/ParaMathUtility.h"
26 #ifndef USE_DIRECTX_RENDERER
27 #include "RenderCoreOpenGL.h"
28 #endif
29 
30 // defining structures as if DirectX exist to be used with OpengGL or Null renderer.
31 
32 namespace ParaEngine
33 {
34  typedef struct _Para3DLight {
35  D3DLIGHTTYPE Type; /* Type of light source */
36  LinearColor Diffuse; /* Diffuse color of light */
37  LinearColor Specular; /* Specular color of light */
38  LinearColor Ambient; /* Ambient color of light */
39  Vector3 Position; /* Position in world space */
40  Vector3 Direction; /* Direction in world space */
41  float Range; /* Cutoff range */
42  float Falloff; /* Falloff */
43  float Attenuation0; /* Constant attenuation */
44  float Attenuation1; /* Linear attenuation */
45  float Attenuation2; /* Quadratic attenuation */
46  float Theta; /* Inner angle of spotlight cone */
47  float Phi; /* Outer angle of spotlight cone */
48  } Para3DLight;
49 
50  typedef struct _ParaMaterial {
51  LinearColor Diffuse; /* Diffuse color RGBA */
52  LinearColor Ambient; /* Ambient color RGB */
53  LinearColor Specular; /* Specular 'shininess' */
54  LinearColor Emissive; /* Emissive color RGB */
55  float Power; /* Sharpness if specular highlight */
56  } ParaMaterial;
57 }
58 
59 namespace ParaEngine
60 {
61 #ifdef USE_DIRECTX_RENDERER
62 
63  typedef IDirect3DTexture9 * DeviceTexturePtr_type;
64  typedef IDirect3DDevice9* RenderDevicePtr;
65  typedef LPDIRECT3DVERTEXDECLARATION9 VertexDeclarationPtr;
66 #elif defined(USE_OPENGL_RENDERER)
67  typedef GLuint DeviceTexturePtr_type;
68  class RenderDevice; typedef RenderDevice* RenderDevicePtr;
69  class CVertexDeclaration; typedef CVertexDeclaration* VertexDeclarationPtr;
70 #else
71  typedef uint32_t DeviceTexturePtr_type;
72  class RenderDevice; typedef RenderDevice* RenderDevicePtr;
73  class CVertexDeclaration; typedef CVertexDeclaration* VertexDeclarationPtr;
74 #endif
75 }
76 
77 #include "ParaViewport.h"
78 #include "ParaVertexBuffer.h"
79 #include "RenderDevice.h"
different physics engine has different winding order.
Definition: EventBinding.h:32
a very thin wrapper to DirectX device with a portable version of openGL implementation.
Definition: RenderDeviceDirectX.h:10
Standard 3-dimensional vector.
Definition: ParaVector3.h:16
Definition: RenderCore.h:50
vertex element
Definition: VertexDeclarationOpenGL.h:21
Definition: RenderCore.h:34
A linear, 32-bit/component floating point RGBA color.
Definition: ParaColor.h:12