Hi Stefanos,
Here is the first part of my main() function that initialises OpenGL (I’ve
snipped all the error checking stuff). The only SDL_GL_SetAttribute() calls
I make are the ones for SDL_GL_DOUBLEBUFFER and SDL_GL_DEPTH_SIZE. Do you
think that may be the cause?
I’ve played around with other parameters (SDL_GL_CONTEXT_PROFILE_MASK,
SDL_GL_CONTEXT_MAJOR_VERSION, SDL_GL_CONTEXT_MINOR_VERSION and
SDL_GL_ACCELERATED_VISUAL), but I’ve removed them since none of them seemed
to make a difference.-------
if(SDL_Init(SDL_INIT_VIDEO | SDL_INIT_TIMER | SDL_INIT_AUDIO) < 0)
sdldie(“Unable to initialize SDL”);
SDL_Window *screen;
if(fullscreen) {
screen = SDL_CreateWindow("Gooey",
SDL_WINDOWPOS_CENTERED,
SDL_WINDOWPOS_CENTERED,
screen_width, screen_height,
SDL_WINDOW_OPENGL | SDL_WINDOW_SHOWN |
SDL_WINDOW_FULLSCREEN_DESKTOP);
} else {
screen = SDL_CreateWindow(“Gooey”,
SDL_WINDOWPOS_CENTERED,
SDL_WINDOWPOS_CENTERED,
screen_width, screen_height,
SDL_WINDOW_OPENGL | SDL_WINDOW_SHOWN | SDL_WINDOW_RESIZABLE);
}
SDL_GL_SetAttribute(SDL_GL_DOUBLEBUFFER, 1);
SDL_GL_SetAttribute(SDL_GL_DEPTH_SIZE, 32);
SDL_GLContext maincontext = SDL_GL_CreateContext(screen);
SDL_GL_SetSwapInterval(1);
glShadeModel(GL_SMOOTH);
glCullFace(GL_BACK);
glFrontFace(GL_CCW);
glEnable(GL_TEXTURE_2D);
glClearColor(0.5,0.5,0.5,0);
float ratio = (float)width/(float)height;
glViewport(0,0,width,height);
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
gluPerspective(60.0, ratio, 0.01, 1024.0);
Thank you,
Werner
Date: Tue, 29 Jul 2014 23:26:02 +0200
From: “Stefanos A.”
To: SDL Development List
Subject: Re: [SDL] NVidia OpenGL performance problems
Message-ID:
<CAJysdvqiXc=08YbGK8_q+9DD0NAAGu=
YiByCFAKQGKfjvDYsrg at mail.gmail.com>
Content-Type: text/plain; charset=“utf-8”
Can you please post the complete list of SDL_GL_Attributes you are setting?
One possibility is that you are requesting a pixel format that is not
hardware accelerated on that specific GPU / drivers.
2014-07-29 23:13 GMT+02:00 Werner Stoop <@Werner_Stoop>:
Hi Gabriel,
Yes, the nVidia card is the only one in the machine.
I’ll try to do what you propose, but since the nvidia machine is not my
own, it will take a while to get back to you on that.
As I’ve told Alex in the other branch of this thread it seems that the
application is indeed using Microsoft’s software OpenGL renderer, but I’m
stumped as to how I convince it to use the GPU instead.
Thanks,
Werner
Date: Tue, 29 Jul 2014 15:05:29 -0300
From: Gabriel Jacobo
To: SDL Development List
Subject: Re: [SDL] NVidia OpenGL performance problems
Message-ID:
<CAKDfes=SU0B4o3p4qLz3AjyCBfD7j1urpLfMN7gZGQ=
FJNG5Wg at mail.gmail.com>
Content-Type: text/plain; charset=“utf-8”
I’m not 100% certain about what’s going on, but I would try doing a test
and load glGetString with SDL_GL_GetProcAddress, without linking to
opengl32 and see what you get from that.
Other than that…is the nVidia card the only card on the computer?
2014-07-29 14:54 GMT-03:00 Werner Stoop <@Werner_Stoop>:
Hi Gabriel,
Without setting any of those options, glGetString(GL_VERSION) reports
OpenGL version 1.1.0 on the NVidia machines.
I don’t use SDL_GL_GetProcAddress, and my linker flags include
sdl2-config --libs
-lopengl32 -lglu32
I’m using MinGW to compile under Windows. sdl2-config --libs
evaluates
to -L/usr/local/lib -lmingw32 -lSDL2main -lSDL2 -mwindows
Thanks,
Werner
(Sorry for replying from the mailing list digest - I haven’t received
your
original response yet. Could be related to when I joined the mailing
list)
Date: Tue, 29 Jul 2014 14:28:44 -0300
From: Gabriel Jacobo
To: SDL Development List
Subject: Re: [SDL] NVidia OpenGL performance problems
Message-ID:
<CAKDfesmP80ggx1w29=
TwjJ7Q_Ot98xR34CbE-rhYrmz4HLn92w at mail.gmail.com>
Content-Type: text/plain; charset=“utf-8”
2014-07-29 13:51 GMT-03:00 Werner Stoop <@Werner_Stoop>:
Dear SDL Users,
I have written an OpenGL application in SDL 2.0 and the performance
is
decent (+/- 50fps) on my development machine (Windows 7, with a
Radeon
graphics card and Catalyst drivers).
The problem is that the performance is almost non-existent (1/3
fps)
on
all of the Windows machines with NVidia graphics cards that I’ve
tested
it
on. It is almost as if the application is being rendered entirely
in
software. I’ve tried it on 3 separate machines, all with the same
results.
I’ve played around with the SDL_GL_SetAttribute()
function, like
trying
to set SDL_GL_CONTEXT_PROFILE_MASK
to
SDL_GL_CONTEXT_PROFILE_COMPATIBILITY
and setting the
SDL_GL_CONTEXT_MAJOR_VERSION
and SDL_GL_CONTEXT_MINOR_VERSION
flags
to
a variety of values, and calling
SDL_GL_SetAttribute(SDL_GL_ACCELERATED_VISUAL, 1);
but none of
them
seems
to make any difference.
What context version do you get with none of this options set? Are
you
loading your gl functions dynamically (using SDL_GL_GetProcAddress)
or
do
you link against a DLL?
–
Gabriel.
SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org
-------------- next part --------------
An HTML attachment was scrubbed…
URL: <
http://lists.libsdl.org/pipermail/sdl-libsdl.org/attachments/20140729/46f58882/attachment-0001.htm