Unable to make GL context current

okay I ran across this error with a program
written on a Window 2000 system. I passed
it to a friend of mine who runs Windows XP.
Well the system exited with the error:

Unable to make GL context current

from the following line of code:

if(!(Screen = SDL_SetVideoMode(W, H, bp, F)))
{ return false; }

well W, H, bp, F were:

( 640, 480, 32, SDL_HWSURFACE | SDL_OPENGLBLIT )

well I ran a SDL_VideoModeOK and it returned
that the resolution was good. So my question
is, is this a problem specific to Windows XP,
and someone knows a way around it, or is there
something else someone knows that I should do?

Isn’t SDL_OPENGLBLIT only there for backward compatibility? Try SDL_OPENGL, perhaps SDL_GL_DOUBLEBUFFER too.On Mon, 13 Sep 2004 15:20:06 +0000 (UTC) Griffey wrote:

okay I ran across this error with a program
written on a Window 2000 system. I passed
it to a friend of mine who runs Windows XP.
Well the system exited with the error:

Unable to make GL context current

from the following line of code:

if(!(Screen = SDL_SetVideoMode(W, H, bp, F)))
{ return false; }

well W, H, bp, F were:

( 640, 480, 32, SDL_HWSURFACE | SDL_OPENGLBLIT )

well I ran a SDL_VideoModeOK and it returned
that the resolution was good. So my question
is, is this a problem specific to Windows XP,
and someone knows a way around it, or is there
something else someone knows that I should do?


SDL mailing list
SDL at libsdl.org
http://www.libsdl.org/mailman/listinfo/sdl

Did you give him a binary or the source? What did you build the
application with? Do any SDL test programs or popular SDL games /
applications recreate this problem?On Sep 13, 2004, at 11:20 AM, Griffey wrote:

okay I ran across this error with a program
written on a Window 2000 system. I passed
it to a friend of mine who runs Windows XP.
Well the system exited with the error:

Unable to make GL context current

from the following line of code:

if(!(Screen = SDL_SetVideoMode(W, H, bp, F)))
{ return false; }

well W, H, bp, F were:

( 640, 480, 32, SDL_HWSURFACE | SDL_OPENGLBLIT )

well I ran a SDL_VideoModeOK and it returned
that the resolution was good. So my question
is, is this a problem specific to Windows XP,
and someone knows a way around it, or is there
something else someone knows that I should do?


SDL mailing list
SDL at libsdl.org
http://www.libsdl.org/mailman/listinfo/sdl

Donny Viszneki <smirk thebuicksix.com> writes:

Did you give him a binary or the source? What did you build the
application with? Do any SDL test programs or popular SDL games /
applications recreate this problem?

binary, built under msvc.net. Compiled fine and ran fine on Windows
2000, failed on Windows XP. Do not know of any applications that
recreated the problem.

Joakim Kolsj? <joakim.kolsjo home.se> writes:

Isn’t SDL_OPENGLBLIT only there for backward compatibility? Try SDL_OPENGL,
perhaps
SDL_GL_DOUBLEBUFFER too.

not that I know of. I’ve seen to many source codes that use it.
Its mainly for blitting 2d graphics and text on top of a 3d
view.

Changing the code to SDL_OPENGL | SDL_DOUBLEBUF only makes other
code fail, mainly the text interface I was going to use under
SDL_ttf.

Griffey wrote:

Joakim Kolsj?? <joakim.kolsjo home.se> writes:

Isn’t SDL_OPENGLBLIT only there for backward compatibility? Try SDL_OPENGL,

perhaps

SDL_GL_DOUBLEBUFFER too.

not that I know of. I’ve seen to many source codes that use it.
Its mainly for blitting 2d graphics and text on top of a 3d
view.

SDL_OPENGLBLIT has been deprecated for three years or so (it got
deprecated shortly after being introduced).

Changing the code to SDL_OPENGL | SDL_DOUBLEBUF only makes other
code fail, mainly the text interface I was going to use under
SDL_ttf.

Of course, you can’t use SDL_ttf on an OpenGL surface.

But does the mode setting work when requestion only SDL_OPENGL and not
SDL_OPENGLBLIT ? i.e. are you telling us that “mode setting with
SDL_OPENGLBLIT set doesn’t work under windows XP” ?

Stephane

Stephane Marchesin <stephane.marchesin wanadoo.fr> writes:

Griffey wrote:
SDL_OPENGLBLIT has been deprecated for three years or so (it got
deprecated shortly after being introduced).

Of course, you can’t use SDL_ttf on an OpenGL surface.

Okay I know SDL_ttf doesn’t work on OpenGL surface, thats the
reason I enjoyed blit so much, I could over lay 2d objects
over a 3d surface. Is there any other way to do this? I’d
prefer to use a ttf as the base of my font, and work with it
directly inside the program then to provide bitmaps and be
locked into one set of fonts. I had a really nice running
test program going, and one of the main functionalities is
currently disabled, since I recompiled in SDL_OPENGL.

But does the mode setting work when requestion only SDL_OPENGL and not
SDL_OPENGLBLIT ? i.e. are you telling us that “mode setting with
SDL_OPENGLBLIT set doesn’t work under windows XP” ?

okay my original test subject is not available, currently.
But on a second Windows XP unit that was just now checked,
SDL_OPENGLBLIT opened fine and function according to the
test program. Also SDL_OPENGL ran with no problems.

So I don’t think its SDL_OPENGLBLIT that is an issue.
Any other ideas?

Griffey <electrumwarrior earthlink.net> writes:

Okay before I get blasted, shoot, I never had a question about
SDL_OPENGLBLIT. After researching the archives for why everyone
is screaming about SDL_OPENGLBLIT, I’ve found several people
complaining about it. Thanks to that, I’m now looking for a
secondary way away from SDL_OPENGLBLIT, since its apparent that
no one wants anyone to use. So if you can point in the
direction of some good documentation to inserting text and
2d graphics on top of the opengl frame work. I’ll go read
them and be on my way. I’ll post again when the original
tester of winxp arrives and we try to open it with SDL_OPENGL
instead of SDL_OPENGLBLIT. Garsh.

I still don’t understand the problem with it, I see several
flames about it all over the place, but they seem more wanting
to point out it hasn’t been updated in 3 years then they are
interested in saying the specific problems with it and what
a person should do to get around it. Also if its so bad,
someone needs to tell NeHe.gamedev.net and SDL_ttf to rewrite
the coding on their sites that calls for it.

Which returns me to an earlier question. Is there an easy
way to get 2d text displayed on the screen without making
bmps, or other images, and then loading them into the program?
I would prefer to use a ttf file that way its simple for
switching back and forth from one font set to another, and
i don’t have to go through the hassle of redoing another
bmp.

The only other example of bringing in ttfs into a system
is done on NeHe’s lesson 13. Well his version is very
heavy in Windows, and my current design is staying as
far from Windows as possible ( I want portability to BeOS,
Linux, and other platforms, its why I chose to go SDL/openGL ).
The Linux and other versions of lesson 13, rely way to much
on thier individual OS’s.

Quoth Griffey , on 2004-09-14 00:35:39 +0000:

Okay I know SDL_ttf doesn’t work on OpenGL surface, thats the
reason I enjoyed blit so much, I could over lay 2d objects
over a 3d surface. Is there any other way to do this? I’d
prefer to use a ttf as the base of my font, and work with it
directly inside the program then to provide bitmaps and be
locked into one set of fonts. I had a really nice running
test program going, and one of the main functionalities is
currently disabled, since I recompiled in SDL_OPENGL.

(One of these days I’m going to put this on the doc wiki someplace
prominent if it isn’t there already. Argh.)

OpenGL provides perfectly good image-drawing functions of its own. If
you have the image data in a known format, you can, among other
things,

  • put the image data into an OpenGL texture (glTexImage2D) and render
    a quadrilateral with that texture in any orientation you please, or
  • use glRasterPos and glDrawPixels to draw the image directly into the
    framebuffer.

The OpenGL documentation can provide more information.

Does that help any?

—> Drake Wilson
-------------- next part --------------
A non-text attachment was scrubbed…
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
URL: http://lists.libsdl.org/pipermail/sdl-libsdl.org/attachments/20040913/c798b36b/attachment.pgp

Griffey <electrumwarrior earthlink.net> writes:

Griffey <electrumwarrior earthlink.net> writes:

Okay before I get blasted, shoot, I never had a question about
SDL_OPENGLBLIT. After researching the archives for why everyone
is screaming about SDL_OPENGLBLIT, I’ve found several people
complaining about it. Thanks to that, I’m now looking for a
secondary way away from SDL_OPENGLBLIT, since its apparent that
no one wants anyone to use. So if you can point in the
direction of some good documentation to inserting text and
2d graphics on top of the opengl frame work. I’ll go read
them and be on my way. I’ll post again when the original
tester of winxp arrives and we try to open it with SDL_OPENGL
instead of SDL_OPENGLBLIT. Garsh.

Drake Wilson wrote:

(One of these days I’m going to put this on the doc wiki someplace
prominent if it isn’t there already. Argh.)

. . . . .

The OpenGL documentation can provide more information.

Does that help any?

—> Drake Wilson

thanks for answering see my other post below this one.
Its all good. (can sense the rolling of the eyes through
the computer). As I said one of the reasons I chose to use
SDL (besides it handling alot of things I hate to handle)
was the SDL_ttf library. I know I can bmp up a font and get
on with life using opengl textures to place 2d images. I
just wanted to know if someone out there had wrote a simpler
way to use ttf fonts in OpenGl without calling A dozen OS
(linux, windows, mac, or BeOS) specific codes or making a bmp
prior to creation. I really wanted to make it where the
my standard issued ttf would be loaded normally, then if they
want to use a ttf from their system, well click a couple
options and insert your directory for ttf and boom away you
go, you have the font you like.

Shoot, if no one knows of a way fine, just say you don’t know.
I’m cool with that, I’ll find some other way around it.

I was already pretty much calling 2d graphics in opengl anyway.

Quoth Griffey , on 2004-09-14 01:36:01 +0000:

As I said one of the reasons I chose to use
SDL (besides it handling alot of things I hate to handle)
was the SDL_ttf library. I know I can bmp up a font and get
on with life using opengl textures to place 2d images. I
just wanted to know if someone out there had wrote a simpler
way to use ttf fonts in OpenGl without calling A dozen OS
(linux, windows, mac, or BeOS) specific codes or making a bmp
prior to creation.

Whosoever said OpenGL textures had to come from bitmap files?

SDL_ttf renders to SDL surfaces. SDL surfaces have pixel data in a
known format; see the SDL_Surface structure documentation. You can
then convert the data to any of the other supported raw-pixel data
formats using SDL_ConvertSurface, if you desire. Then upload the
data from the surface as a texture and render away.

—> Drake Wilson
-------------- next part --------------
A non-text attachment was scrubbed…
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
URL: http://lists.libsdl.org/pipermail/sdl-libsdl.org/attachments/20040913/5e028b72/attachment.pgp

I had originally sent this as a private message ot Griffey (just a
moment ago) then read the rest of the thread and realized perhaps it
should be said aloud.

OGLFT IS THE MAN! http://oglft.sf.net/On Sep 13, 2004, at 10:44 PM, Drake Wilson wrote:

Quoth Griffey , on 2004-09-14 01:36:01
+0000:

As I said one of the reasons I chose to use
SDL (besides it handling alot of things I hate to handle)
was the SDL_ttf library. I know I can bmp up a font and get
on with life using opengl textures to place 2d images. I
just wanted to know if someone out there had wrote a simpler
way to use ttf fonts in OpenGl without calling A dozen OS
(linux, windows, mac, or BeOS) specific codes or making a bmp
prior to creation.

Whosoever said OpenGL textures had to come from bitmap files?

SDL_ttf renders to SDL surfaces. SDL surfaces have pixel data in a
known format; see the SDL_Surface structure documentation. You can
then convert the data to any of the other supported raw-pixel data
formats using SDL_ConvertSurface, if you desire. Then upload the
data from the surface as a texture and render away.

—> Drake Wilson


SDL mailing list
SDL at libsdl.org
http://www.libsdl.org/mailman/listinfo/sdl