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