It?s also worth mentioning that in OS X 10.9, requesting a GL 3.2 context will always give you either a 3.3 or a 4.1 context back, so another workaround is to just always request 3.2 on OS X (and bail on pre-10.9 systems.)On Feb 13, 2014, at 8:47 PM, Daniel C. Sinclair <daniel.c.sinclair at gmail.com> wrote:
Hello, I am trying to use OpenGL 3.3 core profile in SDL2 (checked out today) on OS X 10.9 and get this error:
“Could not initialize OpenGL: Requested GL version is not supported on this platform”
This https://hg.libsdl.org/SDL/rev/bb624b1348da was commited to update the versions that are supported. But the logic seems odd since it is hardcoded to 3.2. If I change “(wantver == 0x0302)” to use 0x0303 it works fine but then I can’t use previous versions.
The following patch isn’t pretty but works. Another option would be just checking the major version and ignoring the minor. I don’t really understand why the versions are checked like this at all (or why the OS X version is checked) so maybe there is a better way.
— a/src/video/cocoa/SDL_cocoaopengl.m Thu Feb 13 11:08:12 2014 -0800
+++ b/src/video/cocoa/SDL_cocoaopengl.m Thu Feb 13 16:29:05 2014 -0800
@@ -186,7 +186,7 @@
if (data->osversion >= 0x1070) {
NSOpenGLPixelFormatAttribute profile = kCGLOGLPVersion_Legacy;
if (_this->gl_config.profile_mask == SDL_GL_CONTEXT_PROFILE_CORE) {
On Mon, Jan 27, 2014 at 4:05 AM, Gabriel Jacobo wrote:
The 2.0.2 release is coming next week!
If you have any critical bugs that require fixing before that happens, please say so as soon as possible. We don’t promise we’ll get all of them fixed, but we’ll do our best.
int buffer[10]
SDL_RWread(rwop, buffer, sizeof(buffer), 4)
This will read 40 bytes of data, and put it into ‘buffer’, which is
intended to hold 32-bit integers. Each int is 4 bytes, or 32-bits.
I already asked them via their feedback formular, but I wanted to get a
quick answer on this here.
Isn’t this wrong? They set the maxnum paramter to 4 here, but expect 10
objects to be read.
Yeah, that doesn’t seem quite right, since sizeof(buffer) would return 40
when using 32-bit ints. It would also make more sense to switch the size
and maxnum arguments.
Jonny DOn Sat, Feb 15, 2014 at 12:56 PM, Julian Winter wrote:
int buffer[10]SDL_RWread(rwop, buffer, sizeof(buffer), 4)
This will read 40 bytes of data, and put it into ‘buffer’, which is
intended to hold 32-bit integers. Each int is 4 bytes, or 32-bits.
I already asked them via their feedback formular, but I wanted to get a
quick answer on this here.
Isn’t this wrong? They set the maxnum paramter to 4 here, but expect 10
objects to be read.
int buffer[10]
SDL_RWread(rwop, buffer, sizeof(buffer), 4)
This will read 40 bytes of data, and put it into ‘buffer’, which is
intended to hold 32-bit integers. Each int is 4 bytes, or 32-bits.
I already asked them via their feedback formular, but I wanted to get a
quick answer on this here.
Isn’t this wrong? They set the maxnum paramter to 4 here, but expect 10
objects to be read.
Did I get this wrong?
I’m not actually certain what the confusion is, so I’ll just explain
my understanding: the API expects the number of objects, in
conjunction with the size of the objects. Now, you would expect the
value given to each to matter, but as far as I know the only case
where it CAN matter which value gets put in which argument is if
you’re targeting a “middle-endian” system where, for example, the
lowest-indexed element in an array is stored at the highest set of
addresses in the array, but the least-significant byte in an integer
is stored at the LOWEST byte of the integer. This would make for a
weird system where it was unnecessarily difficult to convert raw data
to and from network-transportable form, so I assume that such systems
are rare.
Of course, just as weird is that the API looks like this in the first
place. You’d expect it to be some sort of gather-store api, but it
doesn’t have any way that I know of to indicate any amount of memory
to skip, so it’s really no different from a raw-block api on most (and
depending on implementation, all) platforms.
tl;dr: 410 == 104, so don’t worry about it.> Date: Sat, 15 Feb 2014 18:56:44 +0100
From: Julian Winter
To: SDL Development List
Subject: [SDL] SDL_RWread
Yeah, that doesn’t seem quite right, since sizeof(buffer) would
return 40 when using 32-bit ints.
this is definitely a buffer overflow (also in the example following
this one). The SDL_RWread() command reads 160 bytes into a buffer of 40
bytes (assuming sizeof(int) == 4).
Best,
Felix> It would also make more sense to switch the size and maxnum arguments.
Jonny D
On Sat, Feb 15, 2014 at 12:56 PM, Julian Winter wrote:
int buffer[10]SDL_RWread(rwop, buffer, sizeof(buffer), 4)
This will read 40 bytes of data, and put it into ‘buffer’, which is
intended to hold 32-bit integers. Each int is 4 bytes, or 32-bits.
I already asked them via their feedback formular, but I wanted to
get a quick answer on this here.
Isn’t this wrong? They set the maxnum paramter to 4 here, but
expect 10 objects to be read.
One really annoying bug is gamma not working on X11: https://bugzilla.libsdl.org/show_bug.cgi?id=1680
(yes, that one applies to both 1.2 and 2.0)
It’s due to an Xorg bug introduced in 2010 and I doubt that Xorg will
fix it in the near future - and even if they did it would take long
until it’s in the mainstream distributions…
In short: It sucks that setting gamma on X11 doesn’t work at all and SDL
should at least have a workaround setting gamma for the whole screen
(which still works on recent Xorg versions).
One could even try only to set gamma on the screen the window is on (for
multimonitor), but that implies the additional complexity of reacting to
window movement events.
Cheers,
DanielAm 27.01.2014 13:05, schrieb Gabriel Jacobo:
The 2.0.2 release is coming next week!
If you have any critical bugs that require fixing before that happens,
please say so as soon as possible. We don’t promise we’ll get all of
them fixed, but we’ll do our best.
Not a critical bug, but SDL_ShowSimpleMessageBox doesn’t work in Android.
It would be appreciated if it could be fixed since this function is very useful.
Thanks.
PS: Please ignore this reply if it is already fixed.
Not a critical bug, but SDL_ShowSimpleMessageBox doesn’t work in Android.
It would be appreciated if it could be fixed since this function is very
useful.
Thanks.
PS: Please ignore this reply if it is already fixed.
It doesn’t appear to be implemented at all at the moment.
Le lundi, 27 janvier 2014 ? 13:05, Gabriel Jacobo a ?crit :
The 2.0.2 release is coming next week!
If you have any critical bugs that require fixing before that happens, please say so as soon as possible. We don’t promise we’ll get all of them fixed, but we’ll do our best.
Now that I found the issue, I’d be glad if we can do something about this one for 2.0.2.