diff options
author | chirs241097@gmail.com <chirs241097@gmail.com@c17bf020-1265-9734-9302-a83f62007ddb> | 2014-03-15 02:29:19 +0000 |
---|---|---|
committer | chirs241097@gmail.com <chirs241097@gmail.com@c17bf020-1265-9734-9302-a83f62007ddb> | 2014-03-15 02:29:19 +0000 |
commit | 856c345feca062fdfc0b177e0de25489fb1b0c06 (patch) | |
tree | 9018cf4f5245e3b6533e86dfa8ca8486a5859498 /hge | |
parent | f2ce3ddfcb72fc3026ba85bd41849fa1886877e4 (diff) | |
download | bullet-lab-remix-856c345feca062fdfc0b177e0de25489fb1b0c06.tar.xz |
Extend hge with a 3D Rotation method, it's not tested yet.
Fix probable compile errors due to includes.
Diffstat (limited to 'hge')
-rw-r--r-- | hge/graphics.cpp | 16 | ||||
-rw-r--r-- | hge/hge_impl.h | 3 |
2 files changed, 18 insertions, 1 deletions
diff --git a/hge/graphics.cpp b/hge/graphics.cpp index 0bab75a..9688024 100644 --- a/hge/graphics.cpp +++ b/hge/graphics.cpp @@ -253,6 +253,22 @@ void CALL HGE_Impl::Gfx_SetTransform(float x, float y, float dx, float dy, float } } +void CALL HGE_Impl::Gfx_SetTDRotate(float ang, float x, float y, float z) +{ + if (!bTransforming) + { + if ((x == 0.0f) && (y == 0.0f) && (z == 0.0f) && (ang == 0.0f)) + return; // nothing to do here, don't call into the GL. + } + + _render_batch(); + + bTransforming = true; + + pOpenGLDevice->glMatrixMode(GL_MODELVIEW); + pOpenGLDevice->glRotatef(ang, x, y, z); +} + bool CALL HGE_Impl::Gfx_BeginScene(HTARGET targ) { CRenderTargetList *target=(CRenderTargetList *)targ; diff --git a/hge/hge_impl.h b/hge/hge_impl.h index 9c9f813..bcee956 100644 --- a/hge/hge_impl.h +++ b/hge/hge_impl.h @@ -10,7 +10,7 @@ #define HGE_IMPL_UNIX_H #include "unix_compat.h" -#include "../../include/hge.h" +#include "hge.h" #include <stdio.h> #include <dirent.h> #include "SDL/SDL.h" @@ -214,6 +214,7 @@ public: virtual void CALL Gfx_FinishBatch(int nprim); virtual void CALL Gfx_SetClipping(int x=0, int y=0, int w=0, int h=0); virtual void CALL Gfx_SetTransform(float x=0, float y=0, float dx=0, float dy=0, float rot=0, float hscale=0, float vscale=0); + virtual void CALL Gfx_SetTDRotate(float ang=0, float x=0, float y=0, float z=0); virtual HTARGET CALL Target_Create(int width, int height, bool zbuffer); virtual void CALL Target_Free(HTARGET target); |