SDL-mirror/include
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
..
begin_code.h Updated copyright date 2008-12-08 00:27:32 +00:00
close_code.h Updated copyright date 2008-12-08 00:27:32 +00:00
doxyfile SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head. 2006-07-10 21:04:37 +00:00
SDL.h Updated copyright date 2008-12-08 00:27:32 +00:00
SDL_audio.h First shot at new audio resampling code. 2009-01-11 04:46:42 +00:00
SDL_cdrom.h Updated copyright date 2008-12-08 00:27:32 +00:00
SDL_compat.h indent 2009-01-14 04:25:32 +00:00
SDL_config.h.default Updated copyright date 2008-12-08 00:27:32 +00:00
SDL_config.h.in Date: Mon, 23 Mar 2009 09:17:24 +0200 2009-03-24 10:33:12 +00:00
SDL_config_dreamcast.h Updated copyright date 2008-12-08 00:27:32 +00:00
SDL_config_iphoneos.h Mac OS X and iPhoneOS have the full math library 2009-03-03 09:48:00 +00:00
SDL_config_macosx.h Mac OS X and iPhoneOS have the full math library 2009-03-03 09:48:00 +00:00
SDL_config_minimal.h Updated copyright date 2008-12-08 00:27:32 +00:00
SDL_config_nintendods.h Updated copyright date 2008-12-08 00:27:32 +00:00
SDL_config_os2.h Updated copyright date 2008-12-08 00:27:32 +00:00
SDL_config_win32.h Fixed Visual C++ build 2009-01-12 08:46:28 +00:00
SDL_copying.h Updated copyright date 2008-12-08 00:27:32 +00:00
SDL_cpuinfo.h Updated copyright date 2008-12-08 00:27:32 +00:00
SDL_endian.h Fixed bug #537 2009-02-17 04:57:39 +00:00
SDL_error.h Updated copyright date 2008-12-08 00:27:32 +00:00
SDL_events.h Fixed bug #684 2009-02-17 05:59:40 +00:00
SDL_haptic.h Final merge of Google Summer of Code 2008 work... 2008-08-25 09:55:03 +00:00
SDL_joystick.h Updated copyright date 2008-12-08 00:27:32 +00:00
SDL_keyboard.h Updated copyright date 2008-12-08 00:27:32 +00:00
SDL_keysym.h Make the SDL keysyms that represent unprintable ASCII values actually have 2009-01-04 17:10:04 +00:00
SDL_loadso.h Updated copyright date 2008-12-08 00:27:32 +00:00
SDL_main.h Updated copyright date 2008-12-08 00:27:32 +00:00
SDL_mouse.h Updated copyright date 2008-12-08 00:27:32 +00:00
SDL_mutex.h Updated copyright date 2008-12-08 00:27:32 +00:00
SDL_name.h
SDL_opengl.h Updated copyright date 2008-12-08 00:27:32 +00:00
SDL_opengles.h Date: Mon, 23 Mar 2009 09:17:24 +0200 2009-03-24 10:33:12 +00:00
SDL_pixels.h Fixed alpha blending textures with the GDI renderer 2009-02-07 17:56:08 +00:00
SDL_platform.h Corrected case for TargetConditionals.h 2008-12-14 07:22:15 +00:00
SDL_quit.h Updated copyright date 2008-12-08 00:27:32 +00:00
SDL_rect.h Added line clipping 2008-12-23 02:23:18 +00:00
SDL_rwops.h Updated copyright date 2008-12-08 00:27:32 +00:00
SDL_scancode.h Updated copyright date 2008-12-08 00:27:32 +00:00
SDL_stdinc.h Fixed bug #537 2009-02-17 04:57:39 +00:00
SDL_surface.h Reverted SDL_LoadICO_RW() addition, this should go in SDL_image 2009-01-12 06:21:34 +00:00
SDL_syswm.h Date: Wed, 4 Mar 2009 15:38:22 +0200 2009-03-04 15:10:47 +00:00
SDL_thread.h Updated copyright date 2008-12-08 00:27:32 +00:00
SDL_timer.h Updated copyright date 2008-12-08 00:27:32 +00:00
SDL_types.h Updated copyright date 2008-12-08 00:27:32 +00:00
SDL_version.h Added missing void 2009-01-04 23:36:53 +00:00
SDL_video.h Date: Sun, 22 Mar 2009 12:52:29 +0000 2009-03-24 10:43:53 +00:00