OpenGL

is there any nice way to get a window context etc so that one can
render using openGL? (mesa calls or otherwise) ? :slight_smile: i am going to
fiddle with some 3d stuff and im trying to port some of my other gl
stuff to SDL but some very important info about windows and their GC’s
etc is not made public, as far as I can tell

j

is there any nice way to get a window context etc so that one can
render using openGL? (mesa calls or otherwise) ? :slight_smile: i am going to
fiddle with some 3d stuff and im trying to port some of my other gl
stuff to SDL but some very important info about windows and their GC’s
etc is not made public, as far as I can tell

I have the same problem. There is an undocumented global
variable with the window handle, but it does not seem to be exported in
the DLL.

When 3D support is in SDL, there will be no need for a window handle, but
up to then, it is necessary to get it. Maybe one should cast the handle
to a long int, to avoid assumptions on the type of the handle
with different platforms and return 0, if there are no windows on a
platform.

This also rises the question, whether an application should be able to get
multiple instances of SDL. There are games that need multiple windows.

See you

  • MarkusOn 7 Oct 1998, Jeff wrote:

When 3D support is in SDL, there will be no need for a window handle, but
up to then, it is necessary to get it. Maybe one should cast the handle
to a long int, to avoid assumptions on the type of the handle
with different platforms and return 0, if there are no windows on a
platform.

This also rises the question, whether an application should be able to get
multiple instances of SDL. There are games that need multiple windows.

Ahhhhh that brings up two points about SDL…

  1. SDL doesn’t support 3D
    You can’t mix 2D and 3D graphics in hardware, and software 3D is
    relatively slow. The best I could do is put some sort of wrapper
    around OpenGL, but that doesn’t seem very useful. OpenGL is pretty
    cross-platform already, and often has hardware support.

  2. SDL doesn’t support multiple windows
    There are two instances when you could be able to do this:

    1. When you are in a windowed environment
    2. When you are fullscreen in a multi-monitor environment
      There is one instance when you can’t do this:
    3. When you are fullscreen in a single-monitor environment
      Your application doesn’t have control over whether it is running
      in a windowed evironment, so it can’t rely on multiple windows.
      There are GUI windowing toolkits available (like V) already…

    Since almost every platform SDL supports has multi-window capability,
    it’s very possible that SDL could support multiple windows. The
    interface code is even designed with the possibility in mind, but
    currently I don’t assume that it’s possible.

I leave this open to discussion. :slight_smile:

-Sam Lantinga				(slouken at devolution.com)--

Author of Simple DirectMedia Layer -
http://www.devolution.com/~slouken/SDL/

Sam Lantinga writes:

When 3D support is in SDL, there will be no need for a window handle, but
up to then, it is necessary to get it. Maybe one should cast the handle
to a long int, to avoid assumptions on the type of the handle
with different platforms and return 0, if there are no windows on a
platform.

This also rises the question, whether an application should be able to get
multiple instances of SDL. There are games that need multiple windows.

Ahhhhh that brings up two points about SDL…

  1. SDL doesn’t support 3D
    You can’t mix 2D and 3D graphics in hardware, and software 3D is
    relatively slow. The best I could do is put some sort of wrapper
    around OpenGL, but that doesn’t seem very useful. OpenGL is pretty
    cross-platform already, and often has hardware support.

im too tired right now to answer the other points, but as to this one,
SDL ‘not supporting 3D’ doesn’t mean anything. SDL wouldnt 'support’
OpenGL, all OpenGL needs is window information and/or a pointer to the
2 LFB’s in order to render. I got a GTKImage to render using OpenGL
by manipulating it this way. GTK doesn’t support 3D, never will, but
if i get a buffer, shove it to OpenGL, and go on with life, I can
write GTK apps that use OpenGL in some or all windows… :slight_smile:

PS: OpenGL goes fine in software if you have a fast enough computer,
and as for fullscreen for hardware support (excluding the Banshee/Rush
etc) that might be fine for some people as well.

j

im too tired right now to answer the other points, but as to this one,
SDL ‘not supporting 3D’ doesn’t mean anything. SDL wouldnt 'support’
OpenGL, all OpenGL needs is window information and/or a pointer to the
2 LFB’s in order to render. I got a GTKImage to render using OpenGL
by manipulating it this way. GTK doesn’t support 3D, never will, but
if i get a buffer, shove it to OpenGL, and go on with life, I can
write GTK apps that use OpenGL in some or all windows… :slight_smile:

I will definitely look into it. OpenGL just needs a GL context?
I’ll take a look at what that entails. There’s no reason I couldn’t
provide one to OpenGL, and let it go on with life. :slight_smile:

Thanks for the info. :slight_smile:

See ya!
-Sam Lantinga (slouken at devolution.com)–
Author of Simple DirectMedia Layer -
http://www.devolution.com/~slouken/SDL/

is there any nice way to get a window context etc so that one can
render using openGL? (mesa calls or otherwise) ? :slight_smile: i am going to
fiddle with some 3d stuff and im trying to port some of my other gl
stuff to SDL but some very important info about windows and their GC’s
etc is not made public, as far as I can tell

I have the same problem. There is an undocumented global
variable with the window handle, but it does not seem to be exported in
the DLL.

I just reread this and understood the problem.

The private window handle is exported via the custrom window hook extensions.
See the scrap demo and SDL_syswm.h for details.

See ya!
-Sam Lantinga (slouken at devolution.com)> On 7 Oct 1998, Jeff wrote:


Author of Simple DirectMedia Layer -
http://www.devolution.com/~slouken/SDL/

I will definitely look into it. OpenGL just needs a GL context?
I’ll take a look at what that entails. There’s no reason I couldn’t
provide one to OpenGL, and let it go on with life. :slight_smile:

I looked into it… Very few programs use raw GL. Most use glX and/or glut.
While it would be easy to set up the information OpenGL needs to render,
glX and glut are heavily dependent on X11/Win32 specifics and would be
a lot of work to port.

If anybody is really interested, let me know.

See ya!
-Sam Lantinga (slouken at devolution.com)–
Author of Simple DirectMedia Layer -
http://www.devolution.com/~slouken/SDL/

Sam Lantinga writes:

I will definitely look into it. OpenGL just needs a GL context?
I’ll take a look at what that entails. There’s no reason I couldn’t
provide one to OpenGL, and let it go on with life. :slight_smile:

I looked into it… Very few programs use raw GL. Most use glX and/or glut.
While it would be easy to set up the information OpenGL needs to render,
glX and glut are heavily dependent on X11/Win32 specifics and would be
a lot of work to port.

If anybody is really interested, let me know.

I am really interested :slight_smile:

j

I will definitely look into it. OpenGL just needs a GL context?
I’ll take a look at what that entails. There’s no reason I couldn’t
provide one to OpenGL, and let it go on with life. :slight_smile:

I looked into it… Very few programs use raw GL. Most use glX and/or glut.
While it would be easy to set up the information OpenGL needs to render,
glX and glut are heavily dependent on X11/Win32 specifics and would be
a lot of work to port.

If anybody is really interested, let me know.

Isn’t MesaGL already ported to Win32? I believe the source can build on
most UNIX-alikes, Win32, and on something else, too…On Tue, 13 Oct 1998, Sam Lantinga wrote:

See ya!
-Sam Lantinga (slouken at devolution.com)


Author of Simple DirectMedia Layer -
http://www.devolution.com/~slouken/SDL/


Scott M. Stone <sstone at pht.com, sstone at turbolinux.com>

Head of TurboLinux Development/Systems Administrator
Pacific HiTech, Inc (USA) / Pacific HiTech, KK (Japan)
http://www.pht.com http://armadillo.pht.co.jp
http://www.pht.co.jp http://www.turbolinux.com

Isn’t MesaGL already ported to Win32? I believe the source can build on
most UNIX-alikes, Win32, and on something else, too…

Yup. It looks like the source will build on Win32.
You might also check out SciTech’s MGL library, which uses Mesa.

See ya!
-Sam Lantinga (slouken at devolution.com)–
Author of Simple DirectMedia Layer -
http://www.devolution.com/~slouken/SDL/

Sorry I haven’t posted in awhile. With finals and then holidays, I
didn’t have much free time to work on the GL stuff. Anyway, now I have
two weeks of nothing to do before school starts again, and I’d like to
continue working on integrating GL with SDL.

I see that Michael Vance has done something with OpenGL, but I have no
idea how to get at the code (/home/michael/src/SDL/ ??). I’d like to
work with it if that’s possible. How can I get a copy? Has anything
else changed in the last two weeks?

-Kenton Varda

Newsgroups: loki.open-source.sdl

Sorry I haven’t posted in awhile. With finals and then holidays, I
didn’t have much free time to work on the GL stuff. Anyway, now I have
two weeks of nothing to do before school starts again, and I’d like to
continue working on integrating GL with SDL.

Sam and co. seem to be working on an implementation, and have apparantely
gotten decent results. The upside is that they’re going to put it into a 1.1
tree RSN. They also have a completely different way of doing it than what we
came up with, but it’s better in many ways. If you want, I could send you
the pack of e-mails… :slight_smile:

If it’s any consolation, I’m nearly as much in the dark as you are :slight_smile:

-Kenton Varda

Nicholas

----- Original Message -----
From: temporal@gauge3d.org (Kenton Varda)
To: sdl at lokigames.com
Date: Monday, January 03, 2000 10:14 PM
Subject: [SDL] OpenGL

Sorry I haven’t posted in awhile. With finals and then holidays, I
didn’t have much free time to work on the GL stuff. Anyway, now I have
two weeks of nothing to do before school starts again, and I’d like to
continue working on integrating GL with SDL.

Sam and co. seem to be working on an implementation, and have apparantely
gotten decent results. The upside is that they’re going to put it into a 1.1
tree RSN. They also have a completely different way of doing it than what we
came up with, but it’s better in many ways. If you want, I could send you
the pack of e-mails… :slight_smile:

If it’s any consolation, I’m nearly as much in the dark as you are :slight_smile:

No worries, all will come to light tomorrow. :slight_smile:

See ya,
-Sam Lantinga (slouken at devolution.com)

Lead Programmer, Loki Entertainment Software–
“Any sufficiently advanced bug is indistinguishable from a feature”
– Rich Kulawiec

No worries, all will come to light tomorrow. :slight_smile:

There’s no darkness. The skinny:

Two new functions:

/* Set an OpenGL window attribute. /
void SDL_GL_SetAttribute( SDLattr attribute, int value );
/
Swap the back buffer. */
void SDL_GL_SwapBuffers( void );

One new enumeration for SDL_SetVideoMode( ):

#define SDL_OPENGL 0x00000002

Pretty straightforward :).

m.On Tue, Jan 04, 2000 at 12:37:05AM -0800, Sam Lantinga wrote:


Programmer "I wrote a song about dental floss,
Loki Entertainment Software but did anyone’s teeth get cleaner?"
http://lokigames.com/~briareos/ - Frank Zappa, re: the PMRC

There’s no darkness. The skinny:

Two new functions:

/* Set an OpenGL window attribute. /
void SDL_GL_SetAttribute( SDLattr attribute, int value );
/
Swap the back buffer. */
void SDL_GL_SwapBuffers( void );

One new enumeration for SDL_SetVideoMode( ):

#define SDL_OPENGL 0x00000002

Pretty straightforward :).

Give us code, Mike! The code! The code! (insert taped recording of revolting
peasants)

Nicholas

----- Original Message -----
From: briareos@lokigames.com (Michael Vance)
To: sdl at lokigames.com
Date: Tuesday, January 04, 2000 10:03 AM
Subject: Re: [SDL] OpenGL

Michael Vance wrote:

Two new functions:

/* Set an OpenGL window attribute. /
void SDL_GL_SetAttribute( SDLattr attribute, int value );
/
Swap the back buffer. */
void SDL_GL_SwapBuffers( void );

One new enumeration for SDL_SetVideoMode( ):

#define SDL_OPENGL 0x00000002

Pretty straightforward :).

Perfect. That’s pretty much exactly how I was planning to do it. Oh well,
less work for me. :slight_smile:

I assume the development was done in Linux / X. Does it work in Windoze or
Be yet? I’d do it myself except that I don’t have sufficient experience
with those OS’s.

-Kenton Varda

Give us code, Mike! The code! The code! (insert taped recording of revolting
peasants)

$ cvs update -r devel_1_1_0

will probably do it.

m.On Tue, Jan 04, 2000 at 02:00:43PM -0800, Nicholas Vining wrote:


Programmer "I wrote a song about dental floss,
Loki Entertainment Software but did anyone’s teeth get cleaner?"
http://lokigames.com/~briareos/ - Frank Zappa, re: the PMRC

I assume the development was done in Linux / X. Does it work in Windoze or
Be yet? I’d do it myself except that I don’t have sufficient experience

Yep, it just does GLX goodness. Other drivers will have to be
written. The biggest change is actually that window creation now
happens in SetVideoMode and not Init. Sam had to do some crazy stuff
to make this work (crazy only because we did it in about five minutes
:). FWIW, it makes exactly five glX calls: glXChooseVisual,
glXCreateContext, glXMakeCurrent, glXDeleteContext, and
glXSwapBuffers.

I might add that the ABI broke since I changed some enumerant
values. But this pretty much goes without saying…

m.On Tue, Jan 04, 2000 at 05:28:50PM -0600, Kenton Varda wrote:


Programmer "I wrote a song about dental floss,
Loki Entertainment Software but did anyone’s teeth get cleaner?"
http://lokigames.com/~briareos/ - Frank Zappa, re: the PMRC

Hi again,
I now tried to install Mesa-3.1 from the RPMs on the mesa3d site, but
still things dont look different. I tried the Nehe demos and of course
they didnt work. Coudl anyone just please tell me which GL specific
libraries there should be in the usr/local/lib directory?

Im losing so much time with this problem, I hope someone is able to help
me.
thx!

Martin

libGL.so
libGLU.so

Some apps look for:

libMesaGL.so
libMesaGLU.so

If so, just make a symbolic link from one to the other.On Thursday, March 02, 2000 11:27 AM, Martin Kremecek [SMTP:krale at teleweb.at] wrote:

Hi again,
I now tried to install Mesa-3.1 from the RPMs on the mesa3d site, but
still things dont look different. I tried the Nehe demos and of course
they didnt work. Coudl anyone just please tell me which GL specific
libraries there should be in the usr/local/lib directory?

Im losing so much time with this problem, I hope someone is able to help
me.
thx!

Martin