comparison src/video/SDL_video.c @ 910:4ab6d1fd028f

Date: Sat, 26 Jun 2004 14:58:42 +0300 From: "Mike Gorchak" Subject: QNX 6.3 fixes for SDL Sam, I've added new OpenGL framework for SDL, which appeared in the new QNX version - 6.3. I've leave compatibility with previous QNX versions. And I've moved all GL specific functions to the separate module, like it done for the other platforms. SDL is now ready for the QNX 6.3 :)
author Sam Lantinga <slouken@libsdl.org>
date Sun, 18 Jul 2004 19:46:38 +0000
parents 50f5a29c6a17
children 46916168361d
comparison
equal deleted inserted replaced
909:e247a0139900 910:4ab6d1fd028f
562 SDL_ShadowSurface->flags |= SDL_DOUBLEBUF; 562 SDL_ShadowSurface->flags |= SDL_DOUBLEBUF;
563 } 563 }
564 return; 564 return;
565 } 565 }
566 566
567 #ifdef __QNXNTO__
568 #include <sys/neutrino.h>
569 #endif /* __QNXNTO__ */
570
567 /* 571 /*
568 * Set the requested video mode, allocating a shadow buffer if necessary. 572 * Set the requested video mode, allocating a shadow buffer if necessary.
569 */ 573 */
570 SDL_Surface * SDL_SetVideoMode (int width, int height, int bpp, Uint32 flags) 574 SDL_Surface * SDL_SetVideoMode (int width, int height, int bpp, Uint32 flags)
571 { 575 {
736 SDL_GetRelativeMouseState(NULL, NULL); /* Clear first large delta */ 740 SDL_GetRelativeMouseState(NULL, NULL); /* Clear first large delta */
737 741
738 #ifdef HAVE_OPENGL 742 #ifdef HAVE_OPENGL
739 /* Load GL symbols (before MakeCurrent, where we need glGetString). */ 743 /* Load GL symbols (before MakeCurrent, where we need glGetString). */
740 if ( flags & (SDL_OPENGL | SDL_OPENGLBLIT) ) { 744 if ( flags & (SDL_OPENGL | SDL_OPENGLBLIT) ) {
741 #ifndef __QNXNTO__ 745
742 #define SDL_PROC(ret,func,params) \ 746 #ifdef __QNXNTO__
743 do { \ 747 #if (_NTO_VERSION < 630)
744 video->func = SDL_GL_GetProcAddress(#func); \ 748 #define __SDL_NOGETPROCADDR__
745 if ( ! video->func ) { \ 749 #endif /* 6.3.0 */
746 SDL_SetError("Couldn't load GL function: %s\n", #func); \ 750 #endif /* __QNXNTO__ */
747 return(NULL); \ 751
748 } \ 752 #ifdef __SDL_NOGETPROCADDR__
749 } while ( 0 ); 753 #define SDL_PROC(ret,func,params) video->func=func;
750 #else 754 #else
751 #define SDL_PROC(ret,func,params) video->func=func; 755 #define SDL_PROC(ret,func,params) \
752 #endif /* __QNXNTO__ */ 756 do { \
757 video->func = SDL_GL_GetProcAddress(#func); \
758 if ( ! video->func ) { \
759 SDL_SetError("Couldn't load GL function: %s\n", #func); \
760 return(NULL); \
761 } \
762 } while ( 0 );
763
764 #endif /* __SDL_NOGETPROCADDR__ */
765
753 #include "SDL_glfuncs.h" 766 #include "SDL_glfuncs.h"
754 #undef SDL_PROC 767 #undef SDL_PROC
755 } 768 }
756 #endif 769 #endif /* HAVE_OPENGL */
757 770
758 /* If we're running OpenGL, make the context current */ 771 /* If we're running OpenGL, make the context current */
759 if ( (video->screen->flags & SDL_OPENGL) && 772 if ( (video->screen->flags & SDL_OPENGL) &&
760 video->GL_MakeCurrent ) { 773 video->GL_MakeCurrent ) {
761 if ( video->GL_MakeCurrent(this) < 0 ) { 774 if ( video->GL_MakeCurrent(this) < 0 ) {