22 #ifndef STARK_GFX_OPENGL_ACTOR_H 23 #define STARK_GFX_OPENGL_ACTOR_H 25 #include "engines/stark/gfx/renderentry.h" 26 #include "engines/stark/visual/actor.h" 27 #include "engines/stark/gfx/opengl.h" 29 #include "common/hashmap.h" 30 #include "common/hash-ptr.h" 32 #include "graphics/opengl/system_headers.h" 34 #if defined(USE_OPENGL_GAME) 70 typedef _ActorVertex ActorVertex;
72 class OpenGLActorRenderer :
public VisualActor {
74 OpenGLActorRenderer(OpenGLDriver *gfx);
75 virtual ~OpenGLActorRenderer();
77 void render(
const Math::Vector3d &position,
float direction,
const LightEntryArray &lights)
override;
84 ActorVertex *_faceVBO;
85 FaceBufferMap _faceEBO;
88 void uploadVertices();
89 ActorVertex *createModelVBO(
const Model *model);
90 uint32 *createFaceEBO(
const Face *face);
91 void setLightArrayUniform(
const LightEntryArray &lights);
93 Math::Vector3d getShadowLightDirection(
const LightEntryArray &lights,
const Math::Vector3d &actorPosition, Math::Matrix3 worldToModelRot);
95 bool getPointLightContribution(LightEntry *light,
const Math::Vector3d &actorPosition,
96 Math::Vector3d &direction,
float weight = 1.0f);
97 bool getDirectionalLightContribution(LightEntry *light, Math::Vector3d &direction);
98 bool getSpotLightContribution(LightEntry *light,
const Math::Vector3d &actorPosition, Math::Vector3d &direction);
104 #endif // defined(USE_OPENGL_GAME) 106 #endif // STARK_GFX_OPENGL_ACTOR_H