Mercurial > hg > Game > Cerium
diff Renderer/Engine/viewerGL.h @ 922:cb1023423861 draft
moving OpenGL mode now!
author | koba <koba@cr.ie.u-ryukyu.ac.jp> |
---|---|
date | Thu, 29 Jul 2010 22:56:58 +0900 |
parents | |
children | fada580e4604 |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Renderer/Engine/viewerGL.h Thu Jul 29 22:56:58 2010 +0900 @@ -0,0 +1,52 @@ +/** + * OpenGLを用いてレンダリングを行うクラスです。 + * MacOSX上での高速な動作を目的としたViewerです。 + * ViewerとViewerDevice 一体型です。 + * 通常の計算(Move, Collision)はそのままです。 + * 描画の部分はTaskを使わず、OpenGLで直に記述する予定です。 + **/ + +#ifndef INCLUDED_VIEWER_GL +#define INCLUDED_VIEWER_GL + +#include <SDL.h> +#include <SDL_opengl.h> +#include "viewer_types.h" +#include "TaskManager.h" +#include "KeyStat.h" +#include "MainLoop.h" +#include "Application.h" +#include "SceneGraphRoot.h" + + +class cViewerGL : public Viewer { + public: + cViewerGL(TaskManager *m, int b, int w, int h, int _num); + ~cViewerGL(){}; + + SDL_Surface *screen; + // SDL_Surface *bitmap; + + /* override function */ + void video_init(int bpp, int width, int height); + void clean_pixels(); + void clear_screen(); + // void free_device(); + + void run_init(TaskManager *manager, Application *app); + void run_loop(); + void run_finish(); + + void mainLoop(); + void pickup_vertex(); + void obj_draw(float *xyz, float *tex_xyz, float *normal_xyz); + GLuint SDL_GL_LoadTexture(SDL_Surface *surface); + + private: + /* measure for FPS (Frame Per Second) */ + int start_time; + int this_time; + int frames; +}; + +#endif