]> icculus.org git repositories - taylor/freespace2.git/blob - src/graphics/gropengl.cpp
Initial revision
[taylor/freespace2.git] / src / graphics / gropengl.cpp
1 /*
2  * $Logfile: /Freespace2/code/Graphics/GrOpenGL.cpp $
3  * $Revision$
4  * $Date$
5  * $Author$
6  *
7  * Code that uses the OpenGL graphics library
8  *
9  * $Log$
10  * Revision 1.1  2002/05/03 03:28:09  root
11  * Initial revision
12  *
13  * 
14  * 10    7/14/99 9:42a Dave
15  * Put in clear_color debug function. Put in base for 3dnow stuff / P3
16  * stuff
17  * 
18  * 9     7/09/99 9:51a Dave
19  * Added thick polyline code.
20  * 
21  * 8     6/29/99 10:35a Dave
22  * Interface polygon bitmaps! Whee!
23  * 
24  * 7     2/03/99 11:44a Dave
25  * Fixed d3d transparent textures.
26  * 
27  * 6     1/24/99 11:37p Dave
28  * First full rev of beam weapons. Very customizable. Removed some bogus
29  * Int3()'s in low level net code.
30  * 
31  * 5     12/18/98 1:13a Dave
32  * Rough 1024x768 support for Direct3D. Proper detection and usage through
33  * the launcher.
34  * 
35  * 4     12/06/98 2:36p Dave
36  * Drastically improved nebula fogging.
37  * 
38  * 3     11/11/98 5:37p Dave
39  * Checkin for multiplayer testing.
40  * 
41  * 2     10/07/98 10:53a Dave
42  * Initial checkin.
43  * 
44  * 1     10/07/98 10:49a Dave
45  * 
46  * 14    5/20/98 9:46p John
47  * added code so the places in code that change half the palette don't
48  * have to clear the screen.
49  * 
50  * 13    5/06/98 5:30p John
51  * Removed unused cfilearchiver.  Removed/replaced some unused/little used
52  * graphics functions, namely gradient_h and _v and pixel_sp.   Put in new
53  * DirectX header files and libs that fixed the Direct3D alpha blending
54  * problems.
55  * 
56  * 12    4/14/98 12:15p John
57  * Made 16-bpp movies work.
58  * 
59  * 11    3/12/98 5:36p John
60  * Took out any unused shaders.  Made shader code take rgbc instead of
61  * matrix and vector since noone used it like a matrix and it would have
62  * been impossible to do in hardware.   Made Glide implement a basic
63  * shader for online help.  
64  * 
65  * 10    3/10/98 4:18p John
66  * Cleaned up graphics lib.  Took out most unused gr functions.   Made D3D
67  * & Glide have popups and print screen.  Took out all >8bpp software
68  * support.  Made Fred zbuffer.  Made zbuffer allocate dynamically to
69  * support Fred.  Made zbuffering key off of functions rather than one
70  * global variable.
71  * 
72  * 9     12/02/97 4:00p John
73  * Added first rev of thruster glow, along with variable levels of
74  * translucency, which retquired some restructing of palman.
75  * 
76  * 8     10/03/97 9:10a John
77  * added better antialiased line drawer
78  * 
79  * 7     9/23/97 10:45a John
80  * made so you can tell bitblt code to rle a bitmap by passing flag to
81  * gr_set_bitmap
82  * 
83  * 6     9/09/97 11:01a Sandeep
84  * fixed warning level 4 bugs
85  * 
86  * 5     7/10/97 2:06p John
87  * added code to specify alphablending type for bitmaps.
88  * 
89  * 4     6/17/97 7:04p John
90  * added d3d support for gradients.
91  * fixed some color bugs by adding screen signatures instead of watching
92  * flags and palette changes.
93  * 
94  * 3     6/12/97 2:50a Lawrance
95  * bm_unlock() now passed bitmap number, not pointer
96  * 
97  * 2     6/11/97 1:12p John
98  * Started fixing all the text colors in the game.
99  * 
100  * 1     5/12/97 12:14p John
101  *
102  * $NoKeywords: $
103  */
104
105 #ifndef PLAT_UNIX
106 #include <windows.h>
107 #include <windowsx.h>
108 #endif
109
110 #include "osapi.h"
111 #include "2d.h"
112 #include "bmpman.h"
113 #include "floating.h"
114 #include "palman.h"
115 #include "grinternal.h"
116 #include "gropengl.h"
117 #include "line.h"
118
119 static int Inited = 0;
120
121 void gr_opengl_pixel(int x, int y)
122 {
123         if ( x < gr_screen.clip_left ) return;
124         if ( x > gr_screen.clip_right ) return;
125         if ( y < gr_screen.clip_top ) return;
126         if ( y > gr_screen.clip_bottom ) return;
127 }
128
129 void gr_opengl_clear()
130 {
131 }
132
133
134 void gr_opengl_flip()
135 {
136 }
137
138 void gr_opengl_flip_window(uint _hdc, int x, int y, int w, int h )
139 {
140 }
141
142 void gr_opengl_set_clip(int x,int y,int w,int h)
143 {
144         // check for sanity of parameters
145         if (x < 0)
146                 x = 0;
147         if (y < 0)
148                 y = 0;
149
150         if (x >= gr_screen.max_w)
151                 x = gr_screen.max_w - 1;
152         if (y >= gr_screen.max_h)
153                 y = gr_screen.max_h - 1;
154
155         if (x + w > gr_screen.max_w)
156                 w = gr_screen.max_w - x;
157         if (y + h > gr_screen.max_h)
158                 h = gr_screen.max_h - y;
159         
160         if (w > gr_screen.max_w)
161                 w = gr_screen.max_w;
162         if (h > gr_screen.max_h)
163                 h = gr_screen.max_h;
164         
165         gr_screen.offset_x = x;
166         gr_screen.offset_y = y;
167         gr_screen.clip_left = 0;
168         gr_screen.clip_right = w-1;
169         gr_screen.clip_top = 0;
170         gr_screen.clip_bottom = h-1;
171         gr_screen.clip_width = w;
172         gr_screen.clip_height = h;
173 }
174
175 void gr_opengl_reset_clip()
176 {
177         gr_screen.offset_x = 0;
178         gr_screen.offset_y = 0;
179         gr_screen.clip_left = 0;
180         gr_screen.clip_top = 0;
181         gr_screen.clip_right = gr_screen.max_w - 1;
182         gr_screen.clip_bottom = gr_screen.max_h - 1;
183         gr_screen.clip_width = gr_screen.max_w;
184         gr_screen.clip_height = gr_screen.max_h;
185 }
186
187 void gr_opengl_set_font(int fontnum)
188 {
189 }
190
191 void gr_opengl_set_color( int r, int g, int b )
192 {
193         Assert((r >= 0) && (r < 256));
194         Assert((g >= 0) && (g < 256));
195         Assert((b >= 0) && (b < 256));
196
197         gr_screen.current_color.red = (unsigned char)r;
198         gr_screen.current_color.green = (unsigned char)g;
199         gr_screen.current_color.blue = (unsigned char)b;
200 }
201
202 void gr_opengl_set_bitmap( int bitmap_num, int alphablend_mode, int bitblt_mode, float alpha, int sx, int sy )
203 {
204         gr_screen.current_alpha = alpha;
205         gr_screen.current_alphablend_mode = alphablend_mode;
206         gr_screen.current_bitblt_mode = bitblt_mode;
207         gr_screen.current_bitmap = bitmap_num;
208
209         gr_screen.current_bitmap_sx = sx;
210         gr_screen.current_bitmap_sy = sy;
211 }
212
213 void gr_opengl_create_shader(shader * shade, float r, float g, float b, float c )
214 {
215         shade->screen_sig = gr_screen.signature;
216         shade->r = r;
217         shade->g = g;
218         shade->b = b;
219         shade->c = c;
220 }
221
222 void gr_opengl_set_shader( shader * shade )
223 {       
224         if ( shade )    {
225                 if (shade->screen_sig != gr_screen.signature)   {
226                         gr_create_shader( shade, shade->r, shade->g, shade->b, shade->c );
227                 }
228                 gr_screen.current_shader = *shade;
229         } else {
230                 gr_create_shader( &gr_screen.current_shader, 0.0f, 0.0f, 0.0f, 0.0f );
231         }
232 }
233
234
235 void gr_opengl_bitmap_ex(int x,int y,int w,int h,int sx,int sy)
236 {
237         int i,j;
238         bitmap * bmp;
239         ubyte * sptr;
240
241         bmp = bm_lock( gr_screen.current_bitmap, 8, 0 );
242         sptr = (ubyte *)( bmp->data + (sy*bmp->w+sx) );
243
244 //      mprintf(( "x=%d, y=%d, w=%d, h=%d\n", x, y, w, h ));
245 //      mprintf(( "sx=%d, sy=%d, bw=%d, bh=%d\n", sx, sy, bmp->w, bmp->h ));
246
247         for (i=0; i<h; i++ )    {
248                 for ( j=0; j<w; j++ )   {
249                         gr_set_color( gr_palette[sptr[j]*3+0], gr_palette[sptr[j]*3+1], gr_palette[sptr[j]*3+2] );
250                         gr_pixel( x+j, i+y );
251                 }
252                 sptr += bmp->w;
253         }
254         bm_unlock(gr_screen.current_bitmap);
255 }
256
257 void gr_opengl_bitmap(int x, int y)
258 {
259         int w, h;
260
261         bm_get_info( gr_screen.current_bitmap, &w, &h, NULL );
262         int dx1=x, dx2=x+w-1;
263         int dy1=y, dy2=y+h-1;
264         int sx=0, sy=0;
265
266         if ((dx1 > gr_screen.clip_right ) || (dx2 < gr_screen.clip_left)) return;
267         if ((dy1 > gr_screen.clip_bottom ) || (dy2 < gr_screen.clip_top)) return;
268         if ( dx1 < gr_screen.clip_left ) { sx = gr_screen.clip_left-dx1; dx1 = gr_screen.clip_left; }
269         if ( dy1 < gr_screen.clip_top ) { sy = gr_screen.clip_top-dy1; dy1 = gr_screen.clip_top; }
270         if ( dx2 > gr_screen.clip_right )       { dx2 = gr_screen.clip_right; }
271         if ( dy2 > gr_screen.clip_bottom )      { dy2 = gr_screen.clip_bottom; }
272
273         if ( sx < 0 ) return;
274         if ( sy < 0 ) return;
275         if ( sx >= w ) return;
276         if ( sy >= h ) return;
277
278         // Draw bitmap bm[sx,sy] into (dx1,dy1)-(dx2,dy2)
279
280         gr_bitmap_ex(dx1,dy1,dx2-dx1+1,dy2-dy1+1,sx,sy);
281 }
282
283 static void opengl_scanline(int x1,int x2,int y)
284 {
285 }
286
287 void gr_opengl_rect(int x,int y,int w,int h)
288 {
289         int i, swapped=0;
290         int x1 = x, x2;
291         int y1 = y, y2;
292
293         if ( w > 0 )
294                  x2 = x + w - 1;
295         else
296                  x2 = x + w + 1;
297
298         if ( h > 0 )
299                 y2 = y + h - 1;
300         else
301                 y2 = y + h + 1;
302                 
303         if ( x2 < x1 )  {
304                 int tmp;        
305                 tmp = x1;
306                 x1 = x2;
307                 x2 = tmp;
308                 w = -w;
309                 swapped = 1;
310         }
311
312         if ( y2 < y1 )  {
313                 int tmp;        
314                 tmp = y1;
315                 y1 = y2;
316                 y2 = tmp;
317                 h = -h;
318                 swapped = 1;
319         }
320
321         for (i=0; i<h; i++ )
322                 opengl_scanline( x1, x2, y1+i );
323 }
324
325
326 void gr_opengl_shade(int x,int y,int w,int h)
327 {
328 }
329
330 void opengl_mtext(int x, int y, char *s, int len )
331 {
332 }
333
334 void gr_opengl_string(int x,int y,char * text)
335 {
336         char *p, *p1;
337         int w, h;
338
339         p1 = text;
340         do {
341                 p = strchr( p1, '\n' );
342                 if ( p ) { 
343                         *p = 0;
344                         p++;
345                 }
346                 gr_get_string_size( &w, &h, p1 );
347
348                 if ( x == 0x8000 )
349                         opengl_mtext(gr_screen.offset_x+(gr_screen.clip_width-w)/2,y+gr_screen.offset_y,p1,strlen(p1));
350                 else
351                         opengl_mtext(gr_screen.offset_x+x,y+gr_screen.offset_y,p1,strlen(p1));
352
353                 p1 = p;
354                 if ( p1 && (strlen(p1) < 1) ) p1 = NULL;
355                 y += h;
356         } while(p1!=NULL);
357 }
358
359
360
361
362 void gr_opengl_circle( int xc, int yc, int d )
363 {
364         int p,x, y, r;
365
366         r = d/2;
367         p=3-d;
368         x=0;
369         y=r;
370
371         // Big clip
372         if ( (xc+r) < gr_screen.clip_left ) return;
373         if ( (xc-r) > gr_screen.clip_right ) return;
374         if ( (yc+r) < gr_screen.clip_top ) return;
375         if ( (yc-r) > gr_screen.clip_bottom ) return;
376
377         while(x<y)      {
378                 // Draw the first octant
379                 opengl_scanline( xc-y, xc+y, yc-x );
380                 opengl_scanline( xc-y, xc+y, yc+x );
381
382                 if (p<0) 
383                         p=p+(x<<2)+6;
384                 else    {
385                         // Draw the second octant
386                         opengl_scanline( xc-x, xc+x, yc-y );
387                         opengl_scanline( xc-x, xc+x, yc+y );
388                         p=p+((x-y)<<2)+10;
389                         y--;
390                 }
391                 x++;
392         }
393         if(x==y)        {
394                 opengl_scanline( xc-x, xc+x, yc-y );
395                 opengl_scanline( xc-x, xc+x, yc+y );
396         }
397         return;
398 }
399
400
401 void gr_opengl_line(int x1,int y1,int x2,int y2)
402 {
403         int i;
404    int xstep,ystep;
405    int dy=y2-y1;
406    int dx=x2-x1;
407    int error_term=0;
408         int clipped = 0, swapped=0;
409
410         INT_CLIPLINE(x1,y1,x2,y2,gr_screen.clip_left,gr_screen.clip_top,gr_screen.clip_right,gr_screen.clip_bottom,return,clipped=1,swapped=1);
411                 
412         if(dy<0)        {
413                 dy=-dy;
414       ystep=-1;
415         }       else    {
416       ystep=1;
417         }
418
419    if(dx<0)     {
420       dx=-dx;
421       xstep=-1;
422    } else {
423       xstep=1;
424         }
425
426         if(dx>dy)       {
427
428                 for(i=dx+1;i>0;i--) {
429                         gr_pixel( x1, y1 ); 
430                         x1 += xstep;
431          error_term+=dy;
432
433          if(error_term>dx)      {
434                                 error_term-=dx;
435             y1+=ystep;
436          }
437       }
438    } else {
439
440       for(i=dy+1;i>0;i--)       {
441                         gr_pixel( x1, y1 ); 
442                         y1 += ystep;
443          error_term+=dx;
444          if(error_term>0)       {
445             error_term-=dy;
446             x1+=xstep;
447          }
448
449       }
450
451    }
452 }
453
454 #define FIND_SCALED_NUM(x,x0,x1,y0,y1) (((((x)-(x0))*((y1)-(y0)))/((x1)-(x0)))+(y0))
455
456 void gr_opengl_scaler(vertex *va, vertex *vb )
457 {
458         float x0, y0, x1, y1;
459         float u0, v0, u1, v1;
460         float clipped_x0, clipped_y0, clipped_x1, clipped_y1;
461         float clipped_u0, clipped_v0, clipped_u1, clipped_v1;
462         float xmin, xmax, ymin, ymax;
463         int dx0, dy0, dx1, dy1;
464
465         //============= CLIP IT =====================
466
467         x0 = va->sx; y0 = va->sy;
468         x1 = vb->sx; y1 = vb->sy;
469
470         xmin = i2fl(gr_screen.clip_left); ymin = i2fl(gr_screen.clip_top);
471         xmax = i2fl(gr_screen.clip_right); ymax = i2fl(gr_screen.clip_bottom);
472
473         u0 = va->u; v0 = va->v;
474         u1 = vb->u; v1 = vb->v;
475
476         // Check for obviously offscreen bitmaps...
477         if ( (y1<=y0) || (x1<=x0) ) return;
478         if ( (x1<xmin ) || (x0>xmax) ) return;
479         if ( (y1<ymin ) || (y0>ymax) ) return;
480
481         clipped_u0 = u0; clipped_v0 = v0;
482         clipped_u1 = u1; clipped_v1 = v1;
483
484         clipped_x0 = x0; clipped_y0 = y0;
485         clipped_x1 = x1; clipped_y1 = y1;
486
487         // Clip the left, moving u0 right as necessary
488         if ( x0 < xmin )        {
489                 clipped_u0 = FIND_SCALED_NUM(xmin,x0,x1,u0,u1);
490                 clipped_x0 = xmin;
491         }
492
493         // Clip the right, moving u1 left as necessary
494         if ( x1 > xmax )        {
495                 clipped_u1 = FIND_SCALED_NUM(xmax,x0,x1,u0,u1);
496                 clipped_x1 = xmax;
497         }
498
499         // Clip the top, moving v0 down as necessary
500         if ( y0 < ymin )        {
501                 clipped_v0 = FIND_SCALED_NUM(ymin,y0,y1,v0,v1);
502                 clipped_y0 = ymin;
503         }
504
505         // Clip the bottom, moving v1 up as necessary
506         if ( y1 > ymax )        {
507                 clipped_v1 = FIND_SCALED_NUM(ymax,y0,y1,v0,v1);
508                 clipped_y1 = ymax;
509         }
510         
511         dx0 = fl2i(clipped_x0); dx1 = fl2i(clipped_x1);
512         dy0 = fl2i(clipped_y0); dy1 = fl2i(clipped_y1);
513
514         if (dx1<=dx0) return;
515         if (dy1<=dy0) return;
516
517         //============= DRAW IT =====================
518         int u, v, du, dv;
519         int y, w;
520         ubyte * sbits;
521         bitmap * bp;
522         ubyte * spixels;
523         float tmpu, tmpv;
524
525         tmpu = (clipped_u1-clipped_u0) / (dx1-dx0);
526         if ( fl_abs(tmpu) < 0.001f ) {
527                 return;         // scaled up way too far!
528         }
529         tmpv = (clipped_v1-clipped_v0) / (dy1-dy0);
530         if ( fl_abs(tmpv) < 0.001f ) {
531                 return;         // scaled up way too far!
532         }
533
534         bp = bm_lock( gr_screen.current_bitmap, 8, 0 );
535
536         du = fl2f(tmpu*(bp->w-1));
537         dv = fl2f(tmpv*(bp->h-1));
538
539         v = fl2f(clipped_v0*(bp->h-1));
540         u = fl2f(clipped_u0*(bp->w-1)); 
541         w = dx1 - dx0 + 1;
542
543         spixels = (ubyte *)bp->data;
544
545         for (y=dy0; y<=dy1; y++ )                       {
546                 sbits = &spixels[bp->rowsize*(v>>16)];
547
548                 int x, tmp_u;
549                 tmp_u = u;
550                 for (x=0; x<w; x++ )                    {
551                         ubyte c = sbits[ tmp_u >> 16 ];
552                         if ( c != 255 ) {
553                                 gr_set_color( gr_palette[c*3+0], gr_palette[c*3+1], gr_palette[c*3+2] );
554                                 gr_pixel( x+dx0, y );
555                         }
556                         tmp_u += du;
557                 }
558                 v += dv;
559         }
560
561         bm_unlock(gr_screen.current_bitmap);
562
563 }
564
565
566
567 void gr_opengl_tmapper( int nv, vertex * verts[], uint flags )
568 {
569 }
570
571
572 void gr_opengl_gradient(int x1,int y1,int x2,int y2)
573 {
574 }
575
576 void gr_opengl_set_palette(ubyte *new_palette, int is_alphacolor)
577 {
578 }
579
580 void gr_opengl_get_color( int * r, int * g, int * b )
581 {
582         if (r) *r = gr_screen.current_color.red;
583         if (g) *g = gr_screen.current_color.green;
584         if (b) *b = gr_screen.current_color.blue;
585 }
586
587 void gr_opengl_init_color(color *c, int r, int g, int b)
588 {
589         gr_screen.current_color.screen_sig = gr_screen.signature;
590         gr_screen.current_color.red = (unsigned char)r;
591         gr_screen.current_color.green = (unsigned char)g;
592         gr_screen.current_color.blue = (unsigned char)b;
593 }
594
595 void gr_opengl_set_color_fast(color *dst)
596 {
597         if ( dst->screen_sig != gr_screen.signature )   {
598                 gr_init_color( dst, dst->red, dst->green, dst->blue );
599                 return;
600         }
601         gr_screen.current_color = *dst;
602 }
603
604
605
606 void gr_opengl_print_screen(char *filename)
607 {
608
609 }
610
611 int gr_opengl_supports_res_ingame(int res)
612 {
613         return 1;
614 }
615
616 int gr_opengl_supports_res_interface(int res)
617 {
618         return 1;
619 }
620
621 void gr_opengl_cleanup()
622 {
623         if ( !Inited )  return;
624
625         gr_reset_clip();
626         gr_clear();
627         gr_flip();
628
629         Inited = 0;
630 }
631
632 void gr_opengl_fog_set(int fog_mode, int r, int g, int b, float near, float far)
633 {
634 }
635
636 void gr_opengl_get_pixel(int x, int y, int *r, int *g, int *b)
637 {
638 }
639
640 void gr_opengl_get_region(int front, int w, int g, ubyte *data)
641 {
642 }
643
644 void gr_opengl_set_cull(int cull)
645 {
646 }
647
648 void gr_opengl_filter_set(int filter)
649 {
650 }
651
652 // cross fade
653 void gr_opengl_cross_fade(int bmap1, int bmap2, int x1, int y1, int x2, int y2, float pct)
654 {
655 }
656
657 int gr_opengl_tcache_set(int bitmap_id, int bitmap_type, float *u_ratio, float *v_ratio, int fail_on_full = 0, int sx = -1, int sy = -1, int force = 0)
658 {
659         return 1;
660 }
661
662 void gr_opengl_set_clear_color(int r, int g, int b)
663 {
664 }
665
666 void gr_opengl_init()
667 {
668         if ( Inited )   {
669                 gr_opengl_cleanup();
670                 Inited = 0;
671         }
672
673         mprintf(( "Initializing opengl graphics device...\n" ));
674         Inited = 1;
675
676         gr_opengl_clear();
677
678         gr_screen.gf_flip = gr_opengl_flip;
679         gr_screen.gf_flip_window = gr_opengl_flip_window;
680         gr_screen.gf_set_clip = gr_opengl_set_clip;
681         gr_screen.gf_reset_clip = gr_opengl_reset_clip;
682         gr_screen.gf_set_font = gr_opengl_set_font;
683         gr_screen.gf_set_color = gr_opengl_set_color;
684         gr_screen.gf_set_bitmap = gr_opengl_set_bitmap;
685         gr_screen.gf_create_shader = gr_opengl_create_shader;
686         gr_screen.gf_set_shader = gr_opengl_set_shader;
687         gr_screen.gf_clear = gr_opengl_clear;
688         // gr_screen.gf_bitmap = gr_opengl_bitmap;
689         // gr_screen.gf_bitmap_ex = gr_opengl_bitmap_ex;
690         gr_screen.gf_rect = gr_opengl_rect;
691         gr_screen.gf_shade = gr_opengl_shade;
692         gr_screen.gf_string = gr_opengl_string;
693         gr_screen.gf_circle = gr_opengl_circle;
694
695         gr_screen.gf_line = gr_opengl_line;
696         gr_screen.gf_pixel = gr_opengl_pixel;
697         gr_screen.gf_scaler = gr_opengl_scaler;
698         gr_screen.gf_tmapper = gr_opengl_tmapper;
699
700         gr_screen.gf_gradient = gr_opengl_gradient;
701
702         gr_screen.gf_set_palette = gr_opengl_set_palette;
703         gr_screen.gf_get_color = gr_opengl_get_color;
704         gr_screen.gf_init_color = gr_opengl_init_color;
705         gr_screen.gf_set_color_fast = gr_opengl_set_color_fast;
706         gr_screen.gf_print_screen = gr_opengl_print_screen;
707
708         gr_screen.gf_fog_set = gr_opengl_fog_set;       
709
710         gr_screen.gf_get_region = gr_opengl_get_region;
711
712         gr_screen.gf_get_pixel = gr_opengl_get_pixel;
713
714         gr_screen.gf_set_cull = gr_opengl_set_cull;
715
716         gr_screen.gf_cross_fade = gr_opengl_cross_fade;
717
718         gr_screen.gf_filter_set = gr_opengl_filter_set;
719
720         gr_screen.gf_tcache_set = gr_opengl_tcache_set;
721
722         gr_screen.gf_set_clear_color = gr_opengl_set_clear_color;
723 }
724
725
726