Polyphase Game Engine
Loading...
Searching...
No Matches
GxTypes.h
Go to the documentation of this file.
1#pragma once
2
3#if API_GX
4
5#include <gccore.h>
6#include <stdint.h>
7#include "EngineTypes.h"
8
9class World;
10
11struct LightingState
12{
13 bool mEnabled = false;
14 bool mColorChannel = false;
15 uint8_t mMaterialSrc = GX_SRC_REG;
16 uint8_t mLightMask = 0;
17 uint8_t mDiffuseFunc = GX_DF_CLAMP;
18 uint8_t mAttenuationFunc = GX_AF_SPOT;
19
20 LightingState()
21 {
22
23 }
24
25 LightingState(bool enable, bool colorChannel, uint8_t matSrc, uint8_t lightMask, uint8_t diffFunc, uint8_t attenFunc) :
26 mEnabled(enable),
27 mColorChannel(colorChannel),
28 mMaterialSrc(matSrc),
29 mLightMask(lightMask),
30 mDiffuseFunc(diffFunc),
31 mAttenuationFunc(attenFunc)
32 {
33
34 }
35
36 bool operator==(const LightingState& other) const
37 {
38 return
39 mEnabled == other.mEnabled &&
40 mColorChannel == other.mColorChannel &&
41 mMaterialSrc == other.mMaterialSrc &&
42 mLightMask == other.mLightMask &&
43 mDiffuseFunc == other.mDiffuseFunc &&
44 mAttenuationFunc == other.mAttenuationFunc;
45 }
46
47 bool operator!=(const LightingState& other) const
48 {
49 return !operator==(other);
50 }
51};
52
53struct GxContext
54{
55 void* mGpFifo = nullptr;
56 World* mWorld = nullptr;
57
58 // Lighting/Channel control
59 LightingState mLighting;
60 uint8_t mSceneLightMask = 0;
61 uint8_t mSceneNumLights = 0;
63
64 // Fog
65 bool mApplyFog = true;
66 uint8_t mFogType = 0;
67 float mFogStartZ = 0.0f;
68 float mFogEndZ = 0.0f;
69 float mFogNearZ = 0.0f;
70 float mFogFarZ = 0.0f;
71 GXColor mFogColor = {0,0,0,0};
72
73 // Color Scale
74 float mColorScale = 1.0f;
75 float mInvColorScale = 1.0f;
76 uint8_t mColorScaleEnum = GX_CS_SCALE_1;
77};
78
79#endif
#define MAX_LIGHTS_PER_DRAW
Definition Constants.h:24
Definition World.h:24
Definition EngineTypes.h:212