Remove unused functionality.
[SDL.s60v3.git] / src / video / symbian / SDL_epocvideo.cpp
blob4f7ea92486abeb071210019f3143b791d40b36aa
1 /*
2 SDL - Simple DirectMedia Layer
3 Copyright (C) 1997, 1998, 1999, 2000, 2001 Sam Lantinga
5 This library is free software; you can redistribute it and/or
6 modify it under the terms of the GNU Library General Public
7 License as published by the Free Software Foundation; either
8 version 2 of the License, or (at your option) any later version.
10 This library is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 Library General Public License for more details.
15 You should have received a copy of the GNU Library General Public
16 License along with this library; if not, write to the Free
17 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 Sam Lantinga
20 slouken@devolution.com
23 #include "epoc_sdl.h"
24 #include <stdlib.h>
25 #include <stdio.h>
26 #include <string.h>
28 extern "C" {
29 #include "SDL_error.h"
30 #include "SDL_timer.h"
31 #include "SDL_video.h"
32 #undef NULL
33 #include "SDL_pixels_c.h"
34 #include "SDL.h"
35 #include "SDL_mouse.h"
38 #include "SDL_epocvideo.h"
39 #include "SDL_epocevents_c.h"
40 #include <coedef.h>
41 #include <flogger.h>
42 #include <eikenv.h>
43 #include <eikappui.h>
44 #include <eikapp.h>
45 #include "sdlepocapi.h"
46 #include <SDL_gliop.h>
47 #include <egl.h>
48 #include "gles_armv5_def.h"
50 _LIT(KLibName, "SDL");
52 extern "C" {
54 /* Initialization/Query functions */
56 static int S60_VideoInit(_THIS, SDL_PixelFormat *vformat);
57 static SDL_Rect **S60_ListModes(_THIS, SDL_PixelFormat *format, Uint32 flags);
58 static SDL_Surface *S60_SetVideoMode(_THIS, SDL_Surface *current, int width, int height, int bpp, Uint32 flags);
59 static int S60_SetColors(_THIS, int firstcolor, int ncolors,
60 SDL_Color *colors);
61 static void S60_VideoQuit(_THIS);
63 /* Hardware surface functions */
65 static int S60_AllocHWSurface(_THIS, SDL_Surface *surface);
66 static int S60_LockHWSurface(_THIS, SDL_Surface *surface);
67 static int S60_FlipHWSurface(_THIS, SDL_Surface *surface);
68 static void S60_UnlockHWSurface(_THIS, SDL_Surface *surface);
69 static void S60_FreeHWSurface(_THIS, SDL_Surface *surface);
70 static void S60_DirectUpdate(_THIS, int numrects, SDL_Rect *rects);
72 static int S60_Available(void);
73 static SDL_VideoDevice *S60_CreateDevice(int devindex);
75 /* Mouse functions */
76 static WMcursor *S60_CreateWMCursor(_THIS, Uint8 *data, Uint8 *mask, int w, int h, int hot_x, int hot_y);
77 static void S60_FreeWMCursor(_THIS, WMcursor *cursor);
78 static int S60_ShowWMCursor(_THIS, WMcursor *cursor);
80 /*GL Functions*/
81 static int S60_GlesLoadLibrary(_THIS, const char* path);
82 static void* S60_GlesGetProcAddress(_THIS, const char *proc);
83 static int S60_GlesGetAttribute(_THIS, SDL_GLattr attrib, int* value);
84 static int S60_GlesMakeCurrent(_THIS);
85 static void S60_GlesSwapBuffers(_THIS);
88 extern "C"
90 struct WMcursor
95 static TSize GetScreenSize()
97 CWsScreenDevice *sd = new CWsScreenDevice(CEikonEnv::Static()->WsSession());
98 sd->Construct();
99 const TSize sz(sd->SizeInPixels());
100 delete sd;
102 return sz;
105 /* Epoc video driver bootstrap functions */
106 static int S60_Available(void)
108 return 1; /* Always available */
111 static void S60_DeleteDevice(SDL_VideoDevice *device)
113 delete device->gl_data;
114 delete device->hidden;
115 delete device;
118 static SDL_VideoDevice *S60_CreateDevice(int /*devindex*/)
120 SDL_VideoDevice *device;
122 /* Allocate all variables that we free on delete */
123 device = new SDL_VideoDevice;
124 if (device)
126 Mem::FillZ(device, (sizeof *device));
127 device->hidden = new SDL_PrivateVideoData;
128 device->gl_data = new SDL_PrivateGLData;
130 else
132 SDL_OutOfMemory();
133 return 0;
135 if((device->hidden == NULL) || (device->gl_data == NULL))
137 SDL_OutOfMemory();
138 delete device->hidden;
139 delete device->gl_data;
140 delete device;
141 return 0;
144 Mem::FillZ(device->hidden, (sizeof *device->hidden));
146 /* Set the function pointers */
147 device->VideoInit = S60_VideoInit;
148 device->ListModes = S60_ListModes;
149 device->SetVideoMode = S60_SetVideoMode;
150 device->SetColors = S60_SetColors;
151 device->UpdateRects = NULL;
152 device->VideoQuit = S60_VideoQuit;
153 device->AllocHWSurface = S60_AllocHWSurface;
154 device->CheckHWBlit = NULL;
155 device->FillHWRect = NULL;
156 device->SetHWColorKey = NULL;
157 device->SetHWAlpha = NULL;
158 device->LockHWSurface = S60_LockHWSurface;
159 device->UnlockHWSurface = S60_UnlockHWSurface;
160 device->FlipHWSurface = S60_FlipHWSurface;
161 device->FreeHWSurface = S60_FreeHWSurface;
162 device->SetIcon = NULL;
163 device->SetCaption = NULL;
164 device->GetWMInfo = NULL;
165 device->FreeWMCursor = S60_FreeWMCursor;
166 device->CreateWMCursor = S60_CreateWMCursor;
167 device->ShowWMCursor = S60_ShowWMCursor;
168 device->WarpWMCursor = NULL;
169 device->InitOSKeymap = EPOC_InitOSKeymap;
170 device->PumpEvents = EPOC_PumpEvents;
171 device->free = S60_DeleteDevice;
173 /*gles funtions*/
174 device->GL_LoadLibrary = S60_GlesLoadLibrary;
175 device->GL_GetProcAddress = S60_GlesGetProcAddress;
176 device->GL_GetAttribute = S60_GlesGetAttribute;
177 device->GL_MakeCurrent = S60_GlesMakeCurrent;
178 device->GL_SwapBuffers = S60_GlesSwapBuffers;
180 device->gl_data->iLibrary.SetHandle(0);
182 return device;
185 VideoBootStrap EPOC_bootstrap = {
186 "epoc\0\0\0", "EPOC system",
187 S60_Available, S60_CreateDevice
190 int S60_VideoInit(_THIS, SDL_PixelFormat *vformat)
192 /* Initialise Epoc frame buffer */
194 const TDisplayMode displayMode = EpocSdlEnv::DisplayMode();
196 /* The "best" video format should be returned to caller. */
198 vformat->BitsPerPixel = TDisplayModeUtils::NumDisplayModeBitsPerPixel(displayMode);
199 vformat->BytesPerPixel = TDisplayModeUtils::NumDisplayModeBitsPerPixel(displayMode) / 8;
201 Private->iRect = new SDL_Rect*[3];
202 Private->iRect[0] = new SDL_Rect;
203 Private->iRect[1] = new SDL_Rect;
204 Private->iRect[2] = NULL;
206 Private->iScreenPos = TPoint(0, 0);
208 Private->iRect[0]->x = Private->iScreenPos.iX;
209 Private->iRect[0]->y = Private->iScreenPos.iY;
211 Private->iRect[1]->x = Private->iScreenPos.iX;
212 Private->iRect[1]->y = Private->iScreenPos.iY;
214 const TSize sz = GetScreenSize();
216 Private->iRect[0]->w = sz.iWidth;
217 Private->iRect[0]->h = sz.iHeight;
219 Private->iRect[1]->w = sz.iHeight;
220 Private->iRect[1]->h = sz.iWidth;
222 Private->iOrientation = new CAknAppUi::TAppUiOrientation[2];
224 if(sz.iWidth < sz.iHeight)
226 Private->iOrientation[0] = CAknAppUi::EAppUiOrientationPortrait;
227 Private->iOrientation[1] = CAknAppUi::EAppUiOrientationLandscape;
229 else
231 Private->iOrientation[0] = CAknAppUi::EAppUiOrientationLandscape;
232 Private->iOrientation[1] = CAknAppUi::EAppUiOrientationPortrait;
235 return(0);
238 SDL_Rect **S60_ListModes(_THIS, SDL_PixelFormat *format, Uint32 flags)
240 if(flags & SDL_HWSURFACE)
242 if(format->BytesPerPixel != 4) //in HW only full color is supported
243 return NULL;
245 if(flags & SDL_FULLSCREEN)
247 return Private->iRect;
250 return (SDL_Rect **)(-1); //everythingisok, but too small shoes
253 int S60_SetColors(_THIS, int firstcolor, int ncolors, SDL_Color *colors)
255 if ((firstcolor+ncolors) > 256)
256 return -1;
257 TUint32 palette[256];
258 const TDisplayMode mode = EpocSdlEnv::DisplayMode();
259 int c = 0;
261 if(TDisplayModeUtils::NumDisplayModeColors(mode) == 4096)
263 // Set 12 bit palette
264 for(int i = firstcolor; i < firstcolor+ncolors; i++)
266 // 4k value: 0000 rrrr gggg bbbb
267 TUint32 color4K = (colors[c].r & 0x0000f0) << 4;
268 color4K |= (colors[c].g & 0x0000f0);
269 color4K |= (colors[c].b & 0x0000f0) >> 4;
270 palette[i] = color4K;
271 c++;
274 else if(TDisplayModeUtils::NumDisplayModeColors(mode) == 65536)
276 for(int i = firstcolor; i < firstcolor+ncolors; i++)
278 // 64k-colour displays effectively support RGB values
279 // with 5 bits allocated to red, 6 to green and 5 to blue
280 // 64k value: rrrr rggg gggb bbbb
281 TUint32 color64K = (colors[c].r & 0x0000f8) << 8;
282 color64K |= (colors[c].g & 0x0000fc) << 3;
283 color64K |= (colors[c].b & 0x0000f8) >> 3;
284 palette[i] = color64K;
285 c++;
288 else if(TDisplayModeUtils::NumDisplayModeColors(mode) == 16777216)
290 for(int i = firstcolor; i < firstcolor+ncolors; i++)
292 // 16M-colour
293 //0000 0000 rrrr rrrr gggg gggg bbbb bbbb
294 TUint32 color16M = colors[c].r << 16;
295 color16M |= colors[c].g << 8;
296 color16M |= colors[c].b;
297 palette[i] = color16M;
298 c++;
301 else
303 return -2;
305 if(EpocSdlEnv::SetPalette(firstcolor, ncolors, palette) == KErrNone)
307 // palette has been updated, redraw whole screen to include changes
308 EpocSdlEnv::UpdateWholeScreen(true);
310 return 0;
312 return -1;
315 int S60_GlesLoadLibrary(SDL_VideoDevice* _this, const char* path)
317 if(_this->gl_data->iLibrary.Handle() != 0)
318 return KErrAlreadyExists; //already loaded
319 const char* const gles_lib[] = {"libgles_cm.dll", "libSWGLES.dll"};
320 int err = KErrNotFound;
321 for(int i = 0; i < 2 && err != KErrNone; i++)
323 const char* name8 = path == NULL ? gles_lib[i] : path;
324 TFileName lib;
325 lib.Copy(TPtrC8((unsigned char*)name8));
326 err = _this->gl_data->iLibrary.Load(lib);
328 if(err == KErrNone)
329 _this->gl_config.driver_loaded = 1;
330 return err;
333 typedef int (*Ftp)(...);
334 #define DC(x) ((Ftp) S60_GlesGetProcAddress(_this, #x))
336 const char* const OpenGL[] = //these funtions are in gl, but not in gles, at least in all in all versions...
338 "glBegin",
339 "glEnd",
340 "glOrtho",
341 "glPopAttrib",
342 "glPopClientAttrib",
343 "glPushAttrib",
344 "glPushClientAttrib",
345 "glTexCoord2f",
346 "glVertex2i",
347 "glTexParameteri"
350 int NotSupported()
352 User::Panic(_L("SDL, Gles"), KErrNotSupported);
353 return 0;
356 void* S60_GlesGetProcAddress(_THIS, const char *proc)
358 if(_this->gl_data->iLibrary.Handle() == 0)
359 return NULL; //not loaded
360 TLibraryFunction f = NULL;
361 for(int i = 0; i < G_ordinals_count; i++)
363 if(strcmp(G_ordinals[i].name, proc) == 0)
365 f = _this->gl_data->iLibrary.Lookup(G_ordinals[i].ord);
366 break;
370 if(f != NULL) /*Lookup may fail*/
371 return (void*) f;
373 for(int i = 0; i < sizeof(OpenGL) / sizeof(char*); i++)
375 if(strcmp(OpenGL[i], proc) == 0)
376 return (void*) NotSupported;
379 return NULL;
382 int S60_GlesGetAttribute(_THIS, SDL_GLattr aAttrib, int* aValue)
384 EGLint attrib;
385 switch(aAttrib)
387 /*todo*/
388 case SDL_GL_RED_SIZE: attrib = EGL_RED_SIZE; break;
389 case SDL_GL_GREEN_SIZE: attrib = EGL_GREEN_SIZE; break;
390 case SDL_GL_BLUE_SIZE:attrib = EGL_BLUE_SIZE; break;
391 case SDL_GL_ALPHA_SIZE: attrib = EGL_ALPHA_SIZE; break;
392 case SDL_GL_BUFFER_SIZE: attrib = EGL_BUFFER_SIZE; break;
393 case SDL_GL_DOUBLEBUFFER: *aValue = 1; return 0; //always
394 case SDL_GL_DEPTH_SIZE: attrib = EGL_DEPTH_SIZE; break;
395 case SDL_GL_STENCIL_SIZE: attrib = EGL_STENCIL_SIZE; break;
396 case SDL_GL_ACCUM_RED_SIZE:
397 case SDL_GL_ACCUM_GREEN_SIZE:
398 case SDL_GL_ACCUM_BLUE_SIZE:
399 case SDL_GL_ACCUM_ALPHA_SIZE:
400 case SDL_GL_STEREO:
401 case SDL_GL_MULTISAMPLEBUFFERS:
402 case SDL_GL_MULTISAMPLESAMPLES:
403 case SDL_GL_ACCELERATED_VISUAL:
404 case SDL_GL_SWAP_CONTROL:
405 *aValue = 0;
406 return -1;
408 const int success = DC(eglGetConfigAttrib)
410 _this->gl_data->iDisplay,
411 _this->gl_data->iConfig,
412 attrib,
413 aValue);
414 return success == EGL_FALSE ? -1 : 0;
418 int S60_GlesMakeCurrent(_THIS)
420 DC(eglMakeCurrent)
421 (_this->gl_data->iDisplay,
422 _this->gl_data->iSurface,
423 _this->gl_data->iSurface,
424 _this->gl_data->iContext);
425 return DC(eglGetError)();
428 void S60_GlesSwapBuffers(_THIS)
430 DC(eglSwapBuffers)(
431 _this->gl_data->iDisplay,
432 _this->gl_data->iSurface);
435 TDisplayMode GetDisplayMode(int aBitsPerPixel)
437 const TDisplayMode displayMode = EpocSdlEnv::DisplayMode();
438 int dmode = EColorLast;
439 if(TDisplayModeUtils::NumDisplayModeBitsPerPixel(displayMode) == aBitsPerPixel)
441 dmode = displayMode;
443 else
447 --dmode;
449 while(TDisplayModeUtils::IsDisplayModeColor(TDisplayMode(dmode)) &&
450 TDisplayModeUtils::NumDisplayModeBitsPerPixel(TDisplayMode(dmode)) != aBitsPerPixel);
452 return TDisplayMode(dmode);
456 static void glAssert(_THIS)
458 const EGLint err = DC(eglGetError)();
459 if(err != EGL_SUCCESS)
461 User::Leave(err);
465 static void CreateGles(_THIS, RWindow& aWindow, int bpp, SDL_PrivateGLData& aData)
467 SDL_GL_LoadLibrary(NULL); //just if its not already loaded
468 aData.iDisplay = DC(eglGetDisplay)(EGL_DEFAULT_DISPLAY);
469 DC(eglInitialize)(aData.iDisplay, NULL, NULL);
471 glAssert(_this);
473 int configs = 0;
474 EGLConfig* configList = NULL;
475 int configSz = 0;
476 DC(eglGetConfigs)(aData.iDisplay, configList, configSz, &configs);
477 configSz = configs;
479 glAssert(_this);
481 configList = new EGLConfig[configSz];
483 int red, green, blue;
484 if(bpp == 16)
486 red = 5;
487 green = 6;
488 blue = 5;
490 else
492 red = 8;
493 green = 8;
494 blue = 8;
497 const EGLint attribList[] =
499 EGL_SURFACE_TYPE, EGL_WINDOW_BIT,
500 EGL_RED_SIZE, red,
501 EGL_GREEN_SIZE, green,
502 EGL_BLUE_SIZE, blue,
503 EGL_BUFFER_SIZE, EGL_DONT_CARE,
504 EGL_DEPTH_SIZE, 8,
505 EGL_NONE
508 DC(eglChooseConfig)(aData.iDisplay,
509 attribList,
510 configList,
511 configSz,
512 &configs);
515 glAssert(_this);
517 __ASSERT_ALWAYS(configs > 0, User::Invariant());
519 aData.iConfig = configList[0];
521 delete[] configList;
523 aData.iContext = DC(eglCreateContext)(aData.iDisplay,
524 aData.iConfig,
525 EGL_NO_CONTEXT,
526 NULL);
528 glAssert(_this);
530 aData.iSurface = DC(eglCreateWindowSurface)(aData.iDisplay,
531 aData.iConfig,
532 &aWindow,
533 NULL);
535 glAssert(_this);
539 static void DestroyGles(_THIS)
541 if( _this->gl_config.driver_loaded)
543 DC(eglMakeCurrent)(_this->gl_data->iDisplay,
544 EGL_NO_SURFACE,
545 EGL_NO_SURFACE,
546 EGL_NO_CONTEXT);
547 DC(eglDestroySurface)(_this->gl_data->iDisplay, _this->gl_data->iSurface);
548 DC(eglDestroyContext)(_this->gl_data->iDisplay, _this->gl_data->iContext);
549 DC(eglTerminate)(_this->gl_data->iDisplay);
550 _this->gl_data->iLibrary.Close();
551 _this->gl_config.driver_loaded = 0;
555 SDL_Surface *S60_SetVideoMode(_THIS, SDL_Surface *current, int width, int height, int bpp, Uint32 flags)
557 if(flags & SDL_OPENGL)
559 current->flags |= SDL_OPENGL;
560 current->w = width;
561 current->h = height;
563 RWindow* win = EpocSdlEnv::Window();
564 EpocSdlEnv::ApplyGlesDsa();
566 CreateGles(_this, *win, bpp, *_this->gl_data);
568 return current;
571 if(flags & SDL_HWSURFACE)
572 return NULL;
574 // check orientation and resolution validity
575 bool resValid = false;
576 Orientation orientation = CAknAppUi::EAppUiOrientationUnspecified;
577 for(int i=0; i<2; i++)
579 if(width <= Private->iRect[i]->w && height <= Private->iRect[i]->h)
581 orientation = Private->iOrientation[i];
582 resValid = true;
583 break;
586 if(!resValid)
587 return NULL;
589 if(!SDL_ReallocFormat(current, bpp, 0, 0, 0, 0))
590 return NULL;
592 const int numBytesPerPixel = ((bpp-1)>>3) + 1;
593 current->pitch = numBytesPerPixel * width;
595 // set proper surface flags
596 current->flags = SDL_SWSURFACE | SDL_PREALLOC;
597 if(flags & SDL_FULLSCREEN)
598 current->flags |= SDL_FULLSCREEN;
599 if(flags & SDL_RESIZABLE)
600 current->flags |= SDL_RESIZABLE;
601 if(bpp <= 8)
602 current->flags |= SDL_HWPALETTE;
604 current->w = width;
605 current->h = height;
607 // allocate surface
608 const int surfacesize = width * height * numBytesPerPixel;
609 Private->iSwSurfaceSize = TSize(width, height);
611 delete[] (TUint8*)current->pixels;
612 current->pixels = new TUint8[surfacesize];
613 Private->iSwSurface = (TUint8*) current->pixels;
615 if(current->pixels == NULL)
616 return NULL;
618 const TSize sz = GetScreenSize();
620 if(sz.iWidth < sz.iHeight && orientation != CAknAppUi::EAppUiOrientationPortrait ||
621 sz.iWidth > sz.iHeight && orientation != CAknAppUi::EAppUiOrientationLandscape)
623 EpocSdlEnv::SetOrientation(orientation, TSize(width, height), GetDisplayMode(current->format->BitsPerPixel));
625 else
627 if((flags & SDL_RESIZABLE) == 0)
629 TRAPD(err, static_cast<CAknAppUi*>(CEikonEnv::Static()->EikAppUi())->SetOrientationL(orientation));
631 else
633 TRAPD(err, static_cast<CAknAppUi*>(CEikonEnv::Static()->EikAppUi())->SetOrientationL(CAknAppUi::EAppUiOrientationUnspecified));
636 const int err = EpocSdlEnv::AllocSurface(TSize(width, height), GetDisplayMode(current->format->BitsPerPixel));
637 if(err != KErrNone)
638 return NULL;
641 // Set the blit function
642 _this->UpdateRects = S60_DirectUpdate;
644 // Centralize game window on device screen
645 Private->iScreenPos.iX = 0;
646 Private->iScreenPos.iY = 0;
648 return current;
651 static int S60_AllocHWSurface(_THIS, SDL_Surface* surface)
653 return KErrNone == EpocSdlEnv::AllocSurface(TSize(surface->w, surface->h), GetDisplayMode(surface->format->BitsPerPixel));
656 static void S60_FreeHWSurface(_THIS, SDL_Surface* /*surface*/)
660 static int S60_LockHWSurface(_THIS, SDL_Surface* surface)
662 if(EpocSdlEnv::IsDsaAvailable())
664 TUint8* address = EpocSdlEnv::LockHwSurface();
665 if(address != NULL)
667 surface->pixels = address;
668 return 1;
671 return 0;
673 static void S60_UnlockHWSurface(_THIS, SDL_Surface* /*surface*/)
675 EpocSdlEnv::UnlockHwSurface();
678 static int S60_FlipHWSurface(_THIS, SDL_Surface* /*surface*/)
680 return(0);
683 static void S60_DirectUpdate(_THIS, int numrects, SDL_Rect *rects)
685 if(EpocSdlEnv::IsDsaAvailable())
687 if(Private->iSwSurface)
689 const TRect target(TPoint(0, 0), Private->iSwSurfaceSize);
691 if(EpocSdlEnv::GetUpdateWholeScreen())
693 if(!EpocSdlEnv::AddUpdateRect(Private->iSwSurface, target, target))
694 return;
696 else
698 for(int i = 0; i < numrects ;i++)
700 const TRect rect(TPoint(rects[i].x, rects[i].y),
701 TSize(rects[i].w, rects[i].h));
702 if(!EpocSdlEnv::AddUpdateRect(Private->iSwSurface, rect, target))
703 return; //not succesful
704 EpocSdlEnv::UpdateWholeScreen(false);
707 EpocSdlEnv::UpdateSwSurface();
709 SDL_PauseAudio(0);
711 else
713 SDL_PauseAudio(1);
717 /* Note: If we are terminated, this could be called in the middle of
718 another SDL video routine -- notably UpdateRects.
720 void S60_VideoQuit(_THIS)
722 delete[] Private->iOrientation;
724 delete Private->iRect[0];
725 delete Private->iRect[1];
726 delete[] Private->iRect;
728 if(_this->gl_data)
729 DestroyGles(_this);
731 delete[] Private->iSwSurface;
732 Private->iSwSurface = NULL;
733 EpocSdlEnv::FreeSurface();
737 WMcursor *S60_CreateWMCursor(_THIS, Uint8* /*data*/, Uint8* /*mask*/, int /*w*/, int /*h*/, int /*hot_x*/, int /*hot_y*/)
739 // prevents SDL from displaying standard cursor
740 return (WMcursor*) 1;
743 void S60_FreeWMCursor(_THIS, WMcursor* /*cursor*/)
747 int S60_ShowWMCursor(_THIS, WMcursor *cursor)
749 return true;
752 /*FOR GL comp*/
754 void glBegin(GLenum a) {}
755 void glEnd(void) {}
756 void glOrtho(GLdouble l, GLdouble r, GLdouble b, GLdouble t, GLdouble n, GLdouble f) {}
757 void glPopAttrib(void) {}
758 void glPopClientAttrib(void){}
759 void glPushAttrib(GLbitfield mask) {}
760 void glPushClientAttrib(GLbitfield mask) {}
761 void glTexCoord2f(GLfloat s, GLfloat t) {}
762 void glVertex2i(GLint x, GLint y) {}