SDL-mirror/src/video/x11
Sam Lantinga ba096ad053 Date: Sun, 22 Mar 2009 12:52:29 +0000
From: Luke Benstead
Subject: OpenGL 3.0 Context Creation

I've attached a patch which implements OpenGL 3.x context creation on
the latest SVN. I've added two options to SDL_GL_SetAttribute, these
are SDL_GL_CONTEXT_MAJOR_VERSION and SDL_GL_CONTEXT_MINOR_VERSION.
These default to 2 and 1 respectively. If the major version is less
than 3 then the current context creation method is used, otherwise the
appropriate new context creation function is called (depending on the
platform).

Sample code:

    if (SDL_Init(SDL_INIT_VIDEO) != 0) {
        printf("Unable to initialize SDL: %s\n", SDL_GetError());
        return 1;
    }

    SDL_GL_SetAttribute(SDL_GL_CONTEXT_MAJOR_VERSION, 3); //Without these 2 lines, SDL will create a GL 2.x context
    SDL_GL_SetAttribute(SDL_GL_CONTEXT_MINOR_VERSION, 0);
    SDL_GL_SetAttribute(SDL_GL_DOUBLEBUFFER, 1);

    SDL_Surface* screen = SDL_SetVideoMode( 640, 480, 16, SDL_OPENGL | SDL_FULLSCREEN );


I've implemented context creation on both Win32 and X and run basic
tests on both. This patch doesn't provide access to all the options
allowed by the new context creation (e.g. shared contexts, forward
compatible contexts) but they can be added pretty easily.

--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%403567
2009-03-24 10:43:53 +00:00
..
imKStoUCS.c
imKStoUCS.h
SDL_x11dyn.c Added 2009-01-13 19:31:06 +00:00
SDL_x11dyn.h Updated copyright date 2008-12-08 00:27:32 +00:00
SDL_x11events.c indent 2009-01-14 04:25:32 +00:00
SDL_x11events.h Added an API to enable/disable the screen saver. 2009-01-12 06:19:05 +00:00
SDL_x11gamma.c indent 2009-01-30 06:38:44 +00:00
SDL_x11gamma.h Modified and totally untested code to load the color tables for DirectColor and PseudoColor windows. 2009-01-09 20:41:31 +00:00
SDL_x11keyboard.c Fixed bug #669 2009-01-05 06:28:50 +00:00
SDL_x11keyboard.h Updated copyright date 2008-12-08 00:27:32 +00:00
SDL_x11modes.c Don't use DirectColor visuals until we implement DirectColor colormap support 2009-01-02 15:47:49 +00:00
SDL_x11modes.h Fixed pitch alignment problem causing MITSHM error on 16-bit displays 2008-12-25 04:42:28 +00:00
SDL_x11mouse.c define this value if it's not in the system headers 2009-01-05 06:35:16 +00:00
SDL_x11mouse.h Fixed X11 mouse motion/button events - it's not actually safe to cast mouse events to device events. 2009-01-01 07:59:08 +00:00
SDL_x11opengl.c Date: Sun, 22 Mar 2009 12:52:29 +0000 2009-03-24 10:43:53 +00:00
SDL_x11opengl.h Added test program for SDL_CreateWindowFrom() 2009-02-09 05:32:12 +00:00
SDL_x11render.c Fixed destination of XCopyArea() 2009-02-15 06:12:52 +00:00
SDL_x11render.h Updated copyright date 2008-12-08 00:27:32 +00:00
SDL_x11sym.h Implemented X11 maximized state control 2009-02-19 06:48:25 +00:00
SDL_x11video.c Added test program for SDL_CreateWindowFrom() 2009-02-09 05:32:12 +00:00
SDL_x11video.h Added an API to enable/disable the screen saver. 2009-01-12 06:19:05 +00:00
SDL_x11window.c indent 2009-02-19 06:49:59 +00:00
SDL_x11window.h Implemented SDL_SetWindowIcon(), with translucent icon support under X11. 2009-01-02 17:39:48 +00:00