Mercurial > hg > Game > Cerium
annotate Renderer/Engine/viewerGL.h @ 1479:163220e54cc0 draft
remove hard code for TaskLog
author | Daichi TOMA <toma@cr.ie.u-ryukyu.ac.jp> |
---|---|
date | Tue, 24 Jul 2012 17:15:15 +0900 |
parents | f389d7fcc25c |
children |
rev | line source |
---|---|
922 | 1 /** |
2 * OpenGLを用いてレンダリングを行うクラスです。 | |
3 * MacOSX上での高速な動作を目的としたViewerです。 | |
4 * ViewerとViewerDevice 一体型です。 | |
5 * 通常の計算(Move, Collision)はそのままです。 | |
927
fada580e4604
remove garbage codes from viewerGL
koba <koba@cr.ie.u-ryukyu.ac.jp>
parents:
922
diff
changeset
|
6 * 描画の部分はTaskを使わず、OpenGLで直に描画します。 |
922 | 7 **/ |
8 | |
9 #ifndef INCLUDED_VIEWER_GL | |
10 #define INCLUDED_VIEWER_GL | |
11 | |
12 #include <SDL.h> | |
13 #include <SDL_opengl.h> | |
14 #include "viewer_types.h" | |
15 #include "TaskManager.h" | |
927
fada580e4604
remove garbage codes from viewerGL
koba <koba@cr.ie.u-ryukyu.ac.jp>
parents:
922
diff
changeset
|
16 #include "SceneGraphRoot.h" |
922 | 17 #include "KeyStat.h" |
18 #include "MainLoop.h" | |
19 #include "Application.h" | |
927
fada580e4604
remove garbage codes from viewerGL
koba <koba@cr.ie.u-ryukyu.ac.jp>
parents:
922
diff
changeset
|
20 #include "Func.h" |
fada580e4604
remove garbage codes from viewerGL
koba <koba@cr.ie.u-ryukyu.ac.jp>
parents:
922
diff
changeset
|
21 #include "texture.h" |
fada580e4604
remove garbage codes from viewerGL
koba <koba@cr.ie.u-ryukyu.ac.jp>
parents:
922
diff
changeset
|
22 #include "lindaapi.h" |
922 | 23 |
24 | |
929 | 25 namespace OPENGL_PARAM { |
944 | 26 static const double near = -1000.0; |
27 static const double far = 1000.0; | |
28 static const GLfloat lightAmbient[] = {0.25f, 0.25f, 0.25f}; | |
29 static const GLfloat lightDiffuse[] = {1.0f, 1.0f, 1.0f}; | |
30 static const GLfloat lightSpecular[] = {1.0f, 1.0f, 1.0f}; | |
959 | 31 static const GLfloat lightPosition[] = {0.5f, 0.5f, -1.0f, 0.0f}; |
929 | 32 } |
33 | |
944 | 34 class ViewerGL : public Viewer { |
35 public: | |
36 ViewerGL(TaskManager *m, int b, int w, int h, int _num); | |
37 ~ViewerGL(){}; | |
922 | 38 |
944 | 39 private: |
40 bool quit_flag; | |
927
fada580e4604
remove garbage codes from viewerGL
koba <koba@cr.ie.u-ryukyu.ac.jp>
parents:
922
diff
changeset
|
41 |
944 | 42 /* measure for FPS (Frame Per Second) */ |
43 int start_time; | |
44 int this_time; | |
45 int frames; | |
931 | 46 |
944 | 47 public: |
48 void video_init(int bpp, int width, int height); | |
49 void run_loop(); | |
50 void pickup_vertex(); | |
51 void obj_draw(float *xyz, float *tex_xyz, float *normal_xyz); | |
52 void clean_pixels(); | |
53 void clear_screen(); | |
931 | 54 |
944 | 55 /* override function */ |
56 void mainLoop(); | |
57 void run_finish(); | |
922 | 58 }; |
59 | |
60 #endif |