Mercurial > hg > forks > gldragon
comparison dmglrender.h @ 62:baccf2044289
Move the OpenGL rendering, setup etc. into a separate module/class, perhaps
facilitating other types of renderers in future .. maybe.
author | Matti Hamalainen <ccr@tnsp.org> |
---|---|
date | Sat, 14 Dec 2019 16:39:20 +0200 |
parents | |
children | d6ffc59bb84d |
comparison
equal
deleted
inserted
replaced
61:7b138613e2fc | 62:baccf2044289 |
---|---|
1 // | |
2 // GLDragon - OpenGL PLY model viewer / simple benchmark | |
3 // -- OpenGL rendering of DMSimpleScene | |
4 // Programmed and designed by Matti 'ccr' Hämäläinen <ccr@tnsp.org> | |
5 // (C) Copyright 2019 Tecnic Software productions (TNSP) | |
6 // | |
7 // See file "COPYING" for license information. | |
8 // | |
9 #ifndef DMGLRENDER_H | |
10 #define DMGLRENDER_H 1 | |
11 | |
12 #include "dmrender.h" | |
13 #include <SDL_opengl.h> | |
14 | |
15 | |
16 struct DMGLSimpleRenderer : DMSimpleRenderer | |
17 { | |
18 SDL_GLContext glContext; | |
19 | |
20 DMGLSimpleRenderer() | |
21 { | |
22 glContext = NULL; | |
23 } | |
24 | |
25 bool checkErrors(void); | |
26 bool initRender1(void); | |
27 bool initRender2(SDL_Window *window); | |
28 bool initRender3(const int width, const int height); | |
29 void shutdownRenderer(void); | |
30 | |
31 void drawModel(const DMSimpleScene &scene, const DMModel &model, const float time); | |
32 void drawScene(const DMSimpleScene &scene, const float time); | |
33 | |
34 bool compileModelShaders(DMModel &model); | |
35 bool setupLight(const int n, DMLight &light); | |
36 bool setupCamera(DMCamera &camera); | |
37 bool animate(DMSimpleScene &scene, const float time); | |
38 }; | |
39 | |
40 #endif |