Remove LOCAL_C abomination.
[SDL.s60v3.git] / src / video / symbian / SDL_epocvideo.cpp
blobd268d6241ade755e5f4d02de15304a3eaf2185ad
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 void DrawBackground(_THIS);
76 void DirectDraw(_THIS, int numrects, SDL_Rect *rects, TUint16* screenBuffer);
77 void DirectDrawRotated(_THIS, int numrects, SDL_Rect *rects, TUint16* screenBuffer);
79 /* Mouse functions */
81 static WMcursor *S60_CreateWMCursor(_THIS, Uint8 *data, Uint8 *mask, int w, int h, int hot_x, int hot_y);
82 static void S60_FreeWMCursor(_THIS, WMcursor *cursor);
83 static int S60_ShowWMCursor(_THIS, WMcursor *cursor);
85 /*GL Functions*/
86 static int S60_GlesLoadLibrary(_THIS, const char* path);
87 static void* S60_GlesGetProcAddress(_THIS, const char *proc);
88 static int S60_GlesGetAttribute(_THIS, SDL_GLattr attrib, int* value);
89 static int S60_GlesMakeCurrent(_THIS);
90 static void S60_GlesSwapBuffers(_THIS);
93 extern "C"
95 struct WMcursor
100 static TSize GetScreenSize()
102 CWsScreenDevice *sd = new CWsScreenDevice(CEikonEnv::Static()->WsSession());
103 sd->Construct();
104 const TSize sz(sd->SizeInPixels());
105 delete sd;
107 return sz;
110 /* Epoc video driver bootstrap functions */
111 static int S60_Available(void)
113 return 1; /* Always available */
116 static void S60_DeleteDevice(SDL_VideoDevice *device)
118 delete device->gl_data;
119 delete device->hidden;
120 delete device;
123 static SDL_VideoDevice *S60_CreateDevice(int /*devindex*/)
125 SDL_VideoDevice *device;
127 /* Allocate all variables that we free on delete */
128 device = new SDL_VideoDevice;
129 if (device)
131 Mem::FillZ(device, (sizeof *device));
132 device->hidden = new SDL_PrivateVideoData;
133 device->gl_data = new SDL_PrivateGLData;
135 else
137 SDL_OutOfMemory();
138 return 0;
140 if((device->hidden == NULL) || (device->gl_data == NULL))
142 SDL_OutOfMemory();
143 delete device->hidden;
144 delete device->gl_data;
145 delete device;
146 return 0;
149 Mem::FillZ(device->hidden, (sizeof *device->hidden));
151 /* Set the function pointers */
152 device->VideoInit = S60_VideoInit;
153 device->ListModes = S60_ListModes;
154 device->SetVideoMode = S60_SetVideoMode;
155 device->SetColors = S60_SetColors;
156 device->UpdateRects = NULL;
157 device->VideoQuit = S60_VideoQuit;
158 device->AllocHWSurface = S60_AllocHWSurface;
159 device->CheckHWBlit = NULL;
160 device->FillHWRect = NULL;
161 device->SetHWColorKey = NULL;
162 device->SetHWAlpha = NULL;
163 device->LockHWSurface = S60_LockHWSurface;
164 device->UnlockHWSurface = S60_UnlockHWSurface;
165 device->FlipHWSurface = S60_FlipHWSurface;
166 device->FreeHWSurface = S60_FreeHWSurface;
167 device->SetIcon = NULL;
168 device->SetCaption = NULL;
169 device->GetWMInfo = NULL;
170 device->FreeWMCursor = S60_FreeWMCursor;
171 device->CreateWMCursor = S60_CreateWMCursor;
172 device->ShowWMCursor = S60_ShowWMCursor;
173 device->WarpWMCursor = NULL;
174 device->InitOSKeymap = EPOC_InitOSKeymap;
175 device->PumpEvents = EPOC_PumpEvents;
176 device->free = S60_DeleteDevice;
178 /*gles funtions*/
179 device->GL_LoadLibrary = S60_GlesLoadLibrary;
180 device->GL_GetProcAddress = S60_GlesGetProcAddress;
181 device->GL_GetAttribute = S60_GlesGetAttribute;
182 device->GL_MakeCurrent = S60_GlesMakeCurrent;
183 device->GL_SwapBuffers = S60_GlesSwapBuffers;
185 device->gl_data->iLibrary.SetHandle(0);
187 return device;
190 VideoBootStrap EPOC_bootstrap = {
191 "epoc\0\0\0", "EPOC system",
192 S60_Available, S60_CreateDevice
195 int S60_VideoInit(_THIS, SDL_PixelFormat *vformat)
197 /* Initialise Epoc frame buffer */
199 const TDisplayMode displayMode = EpocSdlEnv::DisplayMode();
201 /* The "best" video format should be returned to caller. */
203 vformat->BitsPerPixel = TDisplayModeUtils::NumDisplayModeBitsPerPixel(displayMode);
204 vformat->BytesPerPixel = TDisplayModeUtils::NumDisplayModeBitsPerPixel(displayMode) / 8;
206 Private->iRect = new SDL_Rect*[3];
207 Private->iRect[0] = new SDL_Rect;
208 Private->iRect[1] = new SDL_Rect;
209 Private->iRect[2] = NULL;
211 Private->iScreenPos = TPoint(0, 0);
213 Private->iRect[0]->x = Private->iScreenPos.iX;
214 Private->iRect[0]->y = Private->iScreenPos.iY;
216 Private->iRect[1]->x = Private->iScreenPos.iX;
217 Private->iRect[1]->y = Private->iScreenPos.iY;
219 const TSize sz = GetScreenSize();
221 Private->iRect[0]->w = sz.iWidth;
222 Private->iRect[0]->h = sz.iHeight;
224 Private->iRect[1]->w = sz.iHeight;
225 Private->iRect[1]->h = sz.iWidth;
227 Private->iOrientation = new CAknAppUi::TAppUiOrientation[2];
229 if(sz.iWidth < sz.iHeight)
231 Private->iOrientation[0] = CAknAppUi::EAppUiOrientationPortrait;
232 Private->iOrientation[1] = CAknAppUi::EAppUiOrientationLandscape;
234 else
236 Private->iOrientation[0] = CAknAppUi::EAppUiOrientationLandscape;
237 Private->iOrientation[1] = CAknAppUi::EAppUiOrientationPortrait;
240 return(0);
243 SDL_Rect **S60_ListModes(_THIS, SDL_PixelFormat *format, Uint32 flags)
245 if(flags & SDL_HWSURFACE)
247 if(format->BytesPerPixel != 4) //in HW only full color is supported
248 return NULL;
250 if(flags & SDL_FULLSCREEN)
252 return Private->iRect;
255 return (SDL_Rect **)(-1); //everythingisok, but too small shoes
258 int S60_SetColors(_THIS, int firstcolor, int ncolors, SDL_Color *colors)
260 if ((firstcolor+ncolors) > 256)
261 return -1;
262 TUint32 palette[256];
263 const TDisplayMode mode = EpocSdlEnv::DisplayMode();
264 int c = 0;
266 if(TDisplayModeUtils::NumDisplayModeColors(mode) == 4096)
268 // Set 12 bit palette
269 for(int i = firstcolor; i < firstcolor+ncolors; i++)
271 // 4k value: 0000 rrrr gggg bbbb
272 TUint32 color4K = (colors[c].r & 0x0000f0) << 4;
273 color4K |= (colors[c].g & 0x0000f0);
274 color4K |= (colors[c].b & 0x0000f0) >> 4;
275 palette[i] = color4K;
276 c++;
279 else if(TDisplayModeUtils::NumDisplayModeColors(mode) == 65536)
281 for(int i = firstcolor; i < firstcolor+ncolors; i++)
283 // 64k-colour displays effectively support RGB values
284 // with 5 bits allocated to red, 6 to green and 5 to blue
285 // 64k value: rrrr rggg gggb bbbb
286 TUint32 color64K = (colors[c].r & 0x0000f8) << 8;
287 color64K |= (colors[c].g & 0x0000fc) << 3;
288 color64K |= (colors[c].b & 0x0000f8) >> 3;
289 palette[i] = color64K;
290 c++;
293 else if(TDisplayModeUtils::NumDisplayModeColors(mode) == 16777216)
295 for(int i = firstcolor; i < firstcolor+ncolors; i++)
297 // 16M-colour
298 //0000 0000 rrrr rrrr gggg gggg bbbb bbbb
299 TUint32 color16M = colors[c].r << 16;
300 color16M |= colors[c].g << 8;
301 color16M |= colors[c].b;
302 palette[i] = color16M;
303 c++;
306 else
308 return -2;
310 if(EpocSdlEnv::SetPalette(firstcolor, ncolors, palette) == KErrNone)
312 // palette has been updated, redraw whole screen to include changes
313 EpocSdlEnv::UpdateWholeScreen(true);
315 return 0;
317 return -1;
320 int S60_GlesLoadLibrary(SDL_VideoDevice* _this, const char* path)
322 if(_this->gl_data->iLibrary.Handle() != 0)
323 return KErrAlreadyExists; //already loaded
324 const char* const gles_lib[] = {"libgles_cm.dll", "libSWGLES.dll"};
325 int err = KErrNotFound;
326 for(int i = 0; i < 2 && err != KErrNone; i++)
328 const char* name8 = path == NULL ? gles_lib[i] : path;
329 TFileName lib;
330 lib.Copy(TPtrC8((unsigned char*)name8));
331 err = _this->gl_data->iLibrary.Load(lib);
333 if(err == KErrNone)
334 _this->gl_config.driver_loaded = 1;
335 return err;
338 typedef int (*Ftp)(...);
339 #define DC(x) ((Ftp) S60_GlesGetProcAddress(_this, #x))
341 const char* const OpenGL[] = //these funtions are in gl, but not in gles, at least in all in all versions...
343 "glBegin",
344 "glEnd",
345 "glOrtho",
346 "glPopAttrib",
347 "glPopClientAttrib",
348 "glPushAttrib",
349 "glPushClientAttrib",
350 "glTexCoord2f",
351 "glVertex2i",
352 "glTexParameteri"
355 int NotSupported()
357 User::Panic(_L("SDL, Gles"), KErrNotSupported);
358 return 0;
361 void* S60_GlesGetProcAddress(_THIS, const char *proc)
363 if(_this->gl_data->iLibrary.Handle() == 0)
364 return NULL; //not loaded
365 TLibraryFunction f = NULL;
366 for(int i = 0; i < G_ordinals_count; i++)
368 if(strcmp(G_ordinals[i].name, proc) == 0)
370 f = _this->gl_data->iLibrary.Lookup(G_ordinals[i].ord);
371 break;
375 if(f != NULL) /*Lookup may fail*/
376 return (void*) f;
378 for(int i = 0; i < sizeof(OpenGL) / sizeof(char*); i++)
380 if(strcmp(OpenGL[i], proc) == 0)
381 return (void*) NotSupported;
384 return NULL;
387 int S60_GlesGetAttribute(_THIS, SDL_GLattr aAttrib, int* aValue)
389 EGLint attrib;
390 switch(aAttrib)
392 /*todo*/
393 case SDL_GL_RED_SIZE: attrib = EGL_RED_SIZE; break;
394 case SDL_GL_GREEN_SIZE: attrib = EGL_GREEN_SIZE; break;
395 case SDL_GL_BLUE_SIZE:attrib = EGL_BLUE_SIZE; break;
396 case SDL_GL_ALPHA_SIZE: attrib = EGL_ALPHA_SIZE; break;
397 case SDL_GL_BUFFER_SIZE: attrib = EGL_BUFFER_SIZE; break;
398 case SDL_GL_DOUBLEBUFFER: *aValue = 1; return 0; //always
399 case SDL_GL_DEPTH_SIZE: attrib = EGL_DEPTH_SIZE; break;
400 case SDL_GL_STENCIL_SIZE: attrib = EGL_STENCIL_SIZE; break;
401 case SDL_GL_ACCUM_RED_SIZE:
402 case SDL_GL_ACCUM_GREEN_SIZE:
403 case SDL_GL_ACCUM_BLUE_SIZE:
404 case SDL_GL_ACCUM_ALPHA_SIZE:
405 case SDL_GL_STEREO:
406 case SDL_GL_MULTISAMPLEBUFFERS:
407 case SDL_GL_MULTISAMPLESAMPLES:
408 case SDL_GL_ACCELERATED_VISUAL:
409 case SDL_GL_SWAP_CONTROL:
410 *aValue = 0;
411 return -1;
413 const int success = DC(eglGetConfigAttrib)
415 _this->gl_data->iDisplay,
416 _this->gl_data->iConfig,
417 attrib,
418 aValue);
419 return success == EGL_FALSE ? -1 : 0;
423 int S60_GlesMakeCurrent(_THIS)
425 DC(eglMakeCurrent)
426 (_this->gl_data->iDisplay,
427 _this->gl_data->iSurface,
428 _this->gl_data->iSurface,
429 _this->gl_data->iContext);
430 return DC(eglGetError)();
433 void S60_GlesSwapBuffers(_THIS)
435 DC(eglSwapBuffers)(
436 _this->gl_data->iDisplay,
437 _this->gl_data->iSurface);
440 TDisplayMode GetDisplayMode(int aBitsPerPixel)
442 const TDisplayMode displayMode = EpocSdlEnv::DisplayMode();
443 int dmode = EColorLast;
444 if(TDisplayModeUtils::NumDisplayModeBitsPerPixel(displayMode) == aBitsPerPixel)
446 dmode = displayMode;
448 else
452 --dmode;
454 while(TDisplayModeUtils::IsDisplayModeColor(TDisplayMode(dmode)) &&
455 TDisplayModeUtils::NumDisplayModeBitsPerPixel(TDisplayMode(dmode)) != aBitsPerPixel);
457 return TDisplayMode(dmode);
461 static void glAssert(_THIS)
463 const EGLint err = DC(eglGetError)();
464 if(err != EGL_SUCCESS)
466 User::Leave(err);
470 static void CreateGles(_THIS, RWindow& aWindow, int bpp, SDL_PrivateGLData& aData)
472 SDL_GL_LoadLibrary(NULL); //just if its not already loaded
473 aData.iDisplay = DC(eglGetDisplay)(EGL_DEFAULT_DISPLAY);
474 DC(eglInitialize)(aData.iDisplay, NULL, NULL);
476 glAssert(_this);
478 int configs = 0;
479 EGLConfig* configList = NULL;
480 int configSz = 0;
481 DC(eglGetConfigs)(aData.iDisplay, configList, configSz, &configs);
482 configSz = configs;
484 glAssert(_this);
486 configList = new EGLConfig[configSz];
488 int red, green, blue;
489 if(bpp == 16)
491 red = 5;
492 green = 6;
493 blue = 5;
495 else
497 red = 8;
498 green = 8;
499 blue = 8;
502 const EGLint attribList[] =
504 EGL_SURFACE_TYPE, EGL_WINDOW_BIT,
505 EGL_RED_SIZE, red,
506 EGL_GREEN_SIZE, green,
507 EGL_BLUE_SIZE, blue,
508 EGL_BUFFER_SIZE, EGL_DONT_CARE,
509 EGL_DEPTH_SIZE, 8,
510 EGL_NONE
513 DC(eglChooseConfig)(aData.iDisplay,
514 attribList,
515 configList,
516 configSz,
517 &configs);
520 glAssert(_this);
522 __ASSERT_ALWAYS(configs > 0, User::Invariant());
524 aData.iConfig = configList[0];
526 delete[] configList;
528 aData.iContext = DC(eglCreateContext)(aData.iDisplay,
529 aData.iConfig,
530 EGL_NO_CONTEXT,
531 NULL);
533 glAssert(_this);
535 aData.iSurface = DC(eglCreateWindowSurface)(aData.iDisplay,
536 aData.iConfig,
537 &aWindow,
538 NULL);
540 glAssert(_this);
544 static void DestroyGles(_THIS)
546 if( _this->gl_config.driver_loaded)
548 DC(eglMakeCurrent)(_this->gl_data->iDisplay,
549 EGL_NO_SURFACE,
550 EGL_NO_SURFACE,
551 EGL_NO_CONTEXT);
552 DC(eglDestroySurface)(_this->gl_data->iDisplay, _this->gl_data->iSurface);
553 DC(eglDestroyContext)(_this->gl_data->iDisplay, _this->gl_data->iContext);
554 DC(eglTerminate)(_this->gl_data->iDisplay);
555 _this->gl_data->iLibrary.Close();
556 _this->gl_config.driver_loaded = 0;
560 SDL_Surface *S60_SetVideoMode(_THIS, SDL_Surface *current, int width, int height, int bpp, Uint32 flags)
562 if(flags & SDL_OPENGL)
564 current->flags |= SDL_OPENGL;
565 current->w = width;
566 current->h = height;
568 RWindow* win = EpocSdlEnv::Window();
569 EpocSdlEnv::ApplyGlesDsa();
571 CreateGles(_this, *win, bpp, *_this->gl_data);
573 return current;
576 if(flags & SDL_HWSURFACE)
577 return NULL;
579 // check orientation and resolution validity
580 bool resValid = false;
581 Orientation orientation = CAknAppUi::EAppUiOrientationUnspecified;
582 for(int i=0; i<2; i++)
584 if(width <= Private->iRect[i]->w && height <= Private->iRect[i]->h)
586 orientation = Private->iOrientation[i];
587 resValid = true;
588 break;
591 if(!resValid)
592 return NULL;
594 if(!SDL_ReallocFormat(current, bpp, 0, 0, 0, 0))
595 return NULL;
597 const int numBytesPerPixel = ((bpp-1)>>3) + 1;
598 current->pitch = numBytesPerPixel * width;
600 // set proper surface flags
601 current->flags = SDL_SWSURFACE | SDL_PREALLOC;
602 if(flags & SDL_FULLSCREEN)
603 current->flags |= SDL_FULLSCREEN;
604 if(flags & SDL_RESIZABLE)
605 current->flags |= SDL_RESIZABLE;
606 if(bpp <= 8)
607 current->flags |= SDL_HWPALETTE;
609 current->w = width;
610 current->h = height;
612 // allocate surface
613 const int surfacesize = width * height * numBytesPerPixel;
614 Private->iSwSurfaceSize = TSize(width, height);
616 delete[] (TUint8*)current->pixels;
617 current->pixels = new TUint8[surfacesize];
618 Private->iSwSurface = (TUint8*) current->pixels;
620 if(current->pixels == NULL)
621 return NULL;
623 const TSize sz = GetScreenSize();
625 if(sz.iWidth < sz.iHeight && orientation != CAknAppUi::EAppUiOrientationPortrait ||
626 sz.iWidth > sz.iHeight && orientation != CAknAppUi::EAppUiOrientationLandscape)
628 EpocSdlEnv::SetOrientation(orientation, TSize(width, height), GetDisplayMode(current->format->BitsPerPixel));
630 else
632 if((flags & SDL_RESIZABLE) == 0)
634 TRAPD(err, static_cast<CAknAppUi*>(CEikonEnv::Static()->EikAppUi())->SetOrientationL(orientation));
636 else
638 TRAPD(err, static_cast<CAknAppUi*>(CEikonEnv::Static()->EikAppUi())->SetOrientationL(CAknAppUi::EAppUiOrientationUnspecified));
641 const int err = EpocSdlEnv::AllocSurface(TSize(width, height), GetDisplayMode(current->format->BitsPerPixel));
642 if(err != KErrNone)
643 return NULL;
646 // Set the blit function
647 _this->UpdateRects = S60_DirectUpdate;
649 // Centralize game window on device screen
650 Private->iScreenPos.iX = 0;
651 Private->iScreenPos.iY = 0;
653 return current;
656 static int S60_AllocHWSurface(_THIS, SDL_Surface* surface)
658 return KErrNone == EpocSdlEnv::AllocSurface(TSize(surface->w, surface->h), GetDisplayMode(surface->format->BitsPerPixel));
661 static void S60_FreeHWSurface(_THIS, SDL_Surface* /*surface*/)
665 static int S60_LockHWSurface(_THIS, SDL_Surface* surface)
667 if(EpocSdlEnv::IsDsaAvailable())
669 TUint8* address = EpocSdlEnv::LockHwSurface();
670 if(address != NULL)
672 surface->pixels = address;
673 return 1;
676 return 0;
678 static void S60_UnlockHWSurface(_THIS, SDL_Surface* /*surface*/)
680 EpocSdlEnv::UnlockHwSurface();
683 static int S60_FlipHWSurface(_THIS, SDL_Surface* /*surface*/)
685 return(0);
688 static void S60_DirectUpdate(_THIS, int numrects, SDL_Rect *rects)
690 if(EpocSdlEnv::IsDsaAvailable())
692 if(Private->iSwSurface)
694 const TRect target(TPoint(0, 0), Private->iSwSurfaceSize);
696 if(EpocSdlEnv::GetUpdateWholeScreen())
698 if(!EpocSdlEnv::AddUpdateRect(Private->iSwSurface, target, target))
699 return;
701 else
703 for(int i = 0; i < numrects ;i++)
705 const TRect rect(TPoint(rects[i].x, rects[i].y),
706 TSize(rects[i].w, rects[i].h));
707 if(!EpocSdlEnv::AddUpdateRect(Private->iSwSurface, rect, target))
708 return; //not succesful
709 EpocSdlEnv::UpdateWholeScreen(false);
712 EpocSdlEnv::UpdateSwSurface();
714 SDL_PauseAudio(0);
716 else
718 SDL_PauseAudio(1);
719 EpocSdlEnv::WaitDsaAvailable();
723 /* Note: If we are terminated, this could be called in the middle of
724 another SDL video routine -- notably UpdateRects.
726 void S60_VideoQuit(_THIS)
728 delete[] Private->iOrientation;
730 delete Private->iRect[0];
731 delete Private->iRect[1];
732 delete[] Private->iRect;
734 if(_this->gl_data)
735 DestroyGles(_this);
737 delete[] Private->iSwSurface;
738 Private->iSwSurface = NULL;
739 EpocSdlEnv::FreeSurface();
743 WMcursor *S60_CreateWMCursor(_THIS, Uint8* /*data*/, Uint8* /*mask*/, int /*w*/, int /*h*/, int /*hot_x*/, int /*hot_y*/)
745 // prevents SDL from displaying standard cursor
746 return (WMcursor*) 1;
749 void S60_FreeWMCursor(_THIS, WMcursor* /*cursor*/)
753 int S60_ShowWMCursor(_THIS, WMcursor *cursor)
755 return true;
758 /*FOR GL comp*/
760 void glBegin(GLenum a) {}
761 void glEnd(void) {}
762 void glOrtho(GLdouble l, GLdouble r, GLdouble b, GLdouble t, GLdouble n, GLdouble f) {}
763 void glPopAttrib(void) {}
764 void glPopClientAttrib(void){}
765 void glPushAttrib(GLbitfield mask) {}
766 void glPushClientAttrib(GLbitfield mask) {}
767 void glTexCoord2f(GLfloat s, GLfloat t) {}
768 void glVertex2i(GLint x, GLint y) {}