Ticket #7970: opengl_sdl.cpp.diff

File opengl_sdl.cpp.diff, 2.3 KB (added by SF/luke_br, 23 years ago)

Modified sdl.cpp for OpenGL rendering support

Line 
132a33,48
2> #ifdef OPENGL
3> #include "fb2opengl.h"
4> #define GL_SIZE 320*200
5> char gl_black[GL_SIZE];
6> int gl_shake;
7>
8> void gl_init() {
9> bzero(gl_black,GL_SIZE);
10> gl_shake=0;
11> }
12>
13> void gl_update(void *buf) {
14> fb2gl_update(buf,320,200,320,0,gl_shake);
15> }
16> #endif
17>
18250,253c266,273
19< base[i].r = b[0];
20< base[i].g = b[1];
21< base[i].b = b[2];
22< b += 4;
23---
24> #ifdef OPENGL
25> fb2gl_palette(i+start,b[0],b[1],b[2]);
26> #else
27> base[i].r = b[0];
28> base[i].g = b[1];
29> base[i].b = b[2];
30> #endif
31> b += 4;
32270c290,294
33<
34---
35>
36> #ifdef OPENGL
37> scaling=1;
38> _mode_flags |= DF_REAL_8BIT;
39> #else
40306c330,331
41<
42---
43> #endif
44>
45310a336
46> #ifndef OPENGL
47336a363,365
48> #else
49> {
50> #endif
51350a380,383
52> #ifdef OPENGL
53> fb2gl_init(640,480,0,70, FB2GL_FS | FB2GL_320 | FB2GL_PITCH);
54> gl_init();
55> #else
56356c389,390
57<
58---
59> #endif
60>
61364a399
62> #ifndef OPENGL
63365a401
64> #endif
65545c581,582
66<
67---
68>
69> #ifndef OPENGL
70547a585
71> #endif
72556a595,599
73> #ifdef OPENGL
74> fb2gl_set_palette(_palette_changed_first,
75> _palette_changed_last - _palette_changed_first);
76> gl_update(sdl_tmpscreen->pixels);
77> #else
78560c603,604
79<
80---
81> #endif
82>
83569a614,617
84> #ifdef OPENGL
85> gl_shake=_new_shake_pos;
86> gl_update(sdl_tmpscreen->pixels);
87> #else
88571c619
89<
90---
91> #endif
92576a625
93> #ifndef OPENGL
94662c711,712
95<
96---
97> #endif
98>
99668a719,723
100> #ifdef OPENGL
101> fb2gl_set_palette(_palette_changed_first,
102> _palette_changed_last - _palette_changed_first);
103> gl_update(sdl_tmpscreen->pixels);
104> #else
105671a727
106> #endif
107675c731,732
108<
109---
110>
111> #ifndef OPENGL
112682a740,749
113> #else /* OpenGL */
114> else gl_shake=0; /* _new_sake_pos == _current_shake_pos */
115> if (_palette_changed_last != 0) {
116> fb2gl_set_palette(_palette_changed_first,
117> _palette_changed_last - _palette_changed_first);
118> _palette_changed_last=0;
119> }
120> gl_update(sdl_tmpscreen->pixels);
121> #endif
122>
123877a945,948
124> #ifdef OPENGL
125> fb2gl_set_palette(0,256);
126> gl_update(sdl_tmpscreen->pixels);
127> #else
128882a954
129> #endif