Commit graph

76 commits

Author SHA1 Message Date
Sam Lantinga
2e3beaf83d typo
--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%404004
2009-10-10 06:51:42 +00:00
Sam Lantinga
063b24f5a2 Fixed a few issues compiling with Mac OS X 10.6
Unfortunately the audio and cdrom systems do not build at all, and if you
disable those, SDL still fails to link with these errors:

Undefined symbols:
  "_OBJC_IVAR_$_NSScreen._frame", referenced from:
      -[NSScreen(NSScreenAccess) setFrame:] in SDL_cocoamodes.o
  "_KLGetKeyboardLayoutProperty", referenced from:
      _UpdateKeymap in SDL_cocoakeyboard.o
      _UpdateKeymap in SDL_cocoakeyboard.o
  "_KLGetCurrentKeyboardLayout", referenced from:
      _UpdateKeymap in SDL_cocoakeyboard.o
ld: symbol(s) not found

--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%403771
2009-09-05 07:33:54 +00:00
Sam Lantinga
483f2ba3fb indent
--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%403608
2009-05-23 22:41:08 +00:00
Sam Lantinga
d7b72e290b Fixed bug #721
From  michalziulek@gmail.com   2009-03-28 07:43:34   (-) [reply]

There is a bug in OpenGL 3.x context creation code.
Function glXGetProcAddress is used directly where it should be:
_this->gl_data->glXGetProcAddress. I have attached patch which fixes this on
x11 and win32. Thanks.

--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%403575
2009-04-03 17:19:05 +00:00
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
Sam Lantinga
2aab251e38 Added test program for SDL_CreateWindowFrom()
Make sure OpenGL library is loaded before working with OpenGL windows,
even those created with SDL_CreateWindowFrom()

--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%403521
2009-02-09 05:32:12 +00:00
Sam Lantinga
d123950aa3 Reverted Bob's indent checkin
--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%403475
2009-01-10 21:50:26 +00:00
Bob Pendleton
44fa7675c8 I ran a global "make indent" it modified the following files.
--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%403473
2009-01-09 20:43:30 +00:00
Sam Lantinga
b84ae14eeb Don't use DirectColor visuals until we implement DirectColor colormap support
--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%403425
2009-01-02 15:47:49 +00:00
Sam Lantinga
0c30a927ed Updated copyright date
--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%403321
2008-12-08 00:27:32 +00:00
Sam Lantinga
ede44c4b85 Final merge of Google Summer of Code 2008 work...
Port SDL 1.3 to the Nintendo DS
by Darren Alton, mentored by Sam Lantinga

--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%403188
2008-08-27 15:10:03 +00:00
Sam Lantinga
4dd047e9c7 Couriersud fixed bug #603
Using the following sequence

SDL_Init(..:)
SDL_CreateWindow(..., SDL_WINDOW_OPENGL)
SDL_DestroyWindow
SDL_CreateWindow(..., SDL_WINDOW_OPENGL)

SDL will crash in X11_GL_GetVisual. This is due to the fact that
during SDL_DestroyWindow X11_GL_Shutdown was called because the last window
has been closed.

On the next call to SDL_CreateWindow the library is still loaded and only the
memory is reinitialized. Function pointers such as gl_data->glXChooseVisual
will not be reinitialized.

Consequently, SDL will crash due to a NULL pointer access.

The attached patch corrects the behaviour.

--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%403174
2008-08-26 02:47:26 +00:00
Bob Pendleton
d8da8f7c27 In testdyngl.c the event type was being anded (&) with SDL_KEYDOWN and if the result was none zero the program was quiting. This is very weird because it was
working earlier this week.

I added some more trace code to SDL_x11events.c

In SDL_X11opengl.c I modified SDL_GL_GetSwapInterval() so that it returns a pretty good value even if you have the SGI swap extension instead of the MESA swap
extension. I just saved the value you set and return it too you.

--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%402744
2008-03-07 23:57:15 +00:00
Bob Pendleton
c19af725fa more valgrind errors fixed. Plus I ran make indent which changed a few files.
--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%402741
2008-03-07 17:20:37 +00:00
Bob Pendleton
b315d5379d Fixed many valgrind errors. But, I broke testdyngl.
--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%402740
2008-03-06 23:07:02 +00:00
Bob Pendleton
011c8c6dc3 Fixing valgrind errors.
One of the error was the result of an unitended recursive call to X11_GL_LoadLibrary which was also fixed.

--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%402739
2008-03-06 17:08:10 +00:00
Bob Pendleton
b8101a644e Deleted a call to X__PumpEvents at the end of X11_GL_InitExtensions(). This function is being called from SDL_RecreateWindow at a point when the numwindows value in
is incorrect. The result is that an illegal access is being made in X_PumpEvents when it tries to look up the windows ID of the source of an event. Taking out that
call does not seem to have any effect on the testgl. But, I would be happy if someone else took a look at this problem and found a fix higher up the stack.

--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%402737
2008-03-01 20:34:36 +00:00
Sam Lantinga
b480be4c28 indent
--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%402606
2007-08-15 03:50:49 +00:00
Sam Lantinga
6113055717 Date: Wed, 15 Aug 2007 01:08:38 +0200
From: Couriersud
Subject: Some SDL1.3 patches

LoadLibrary will call X11_GL_Initialize. If LoadLibrary is called before
a window is created, it will crash since structures are not properly set
up.

--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%402605
2007-08-15 03:34:14 +00:00
Sam Lantinga
a3245a4e7c Creating a context makes it current, per the documentation.
Applied a variant of the multi-card OpenGL fix from SDL 1.2

--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%402497
2007-07-12 06:31:36 +00:00
Ryan C. Gordon
58207d9ed7 Date: Wed, 23 May 2007 00:39:47 +0300
From: "Eyal Lotem"
To: "SDL Mailing List" <sdl@lists.libsdl.org>
Subject: [SDL] Bug in GL_SWAP_CONTROL extension name.

The checked extension name is incorrect.
The attached patch fixes it to the correct name.

I don't think that under any setup, this extension name was ever
correct, which is why its not OR'd against the old check.

This fixes the "tear effect" (vsync problems) I had here with nVidia
GLX drivers.

Eyal

--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%402311
2007-05-22 22:13:56 +00:00
Sam Lantinga
c8d7322dc6 Simplified driver window creation code.
Implemented several Cocoa window functions

--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%402002
2006-07-29 21:51:00 +00:00
Sam Lantinga
7f0d36082f --HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%402001
2006-07-29 03:57:55 +00:00
Sam Lantinga
89ab980b38 Don't unload the OpenGL library before the X display is closed.
--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%402000
2006-07-29 03:56:35 +00:00
Sam Lantinga
529b4ad049 We're not querying the glX attributes anymore...
--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%401999
2006-07-28 08:46:24 +00:00
Sam Lantinga
931e1c106d Implemented X11 OpenGL support.
Added support for the SDL_VIDEO_OPENGL environment variable.

--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%401998
2006-07-28 08:43:17 +00:00