Trying to use SDL with OpenGL and GGI

Hi,

I am working on a Sun Sparc, running Solaris 9. I have built SDL-1.2.9,
and libggi-2.1.2. I am trying to use OpenGL with the ggi driver for
SDL. So I do

export SDL_VIDEODRIVER=ggi

and then run the “testgl” program in the SDL distribution. I get:

bash-3.00$ testgl
LibGGI: No explicit target specified.
LibGGI: Try to use display-x…
LibGGI: No explicit target specified.
LibGGI: Try to use display-x…
GGI_SetVideoMode()
Couldn’t set GL mode: OpenGL not available
bash-3.00$

Now when I set

export SDL_VIDEODRIVER=x11,

I get

bash-3.00$ testgl
Screen BPP: 32

Vendor : Sun Microsystems, Inc.
Renderer : Elite-3D, VIS
Version : 1.3 Sun OpenGL 1.3patch 113886-05 for Solaris
Extensions : GL_EXT_texture3D GL_SGI_color_table
GL_SGI_texture_color_table GL_EXT_abgr GL_EXT_rescale_normal
GL_SUNX_surface_hint GL_EXT_multi_draw_arrays GL_SUN_multi_draw_arrays
GL_SUNX_constant_data GL_EXT_polygon_offset GL_SUN_vertex
GL_SUN_global_alpha GL_ARB_transpose_matrix GL_ARB_texture_compression
GL_SUNX_geometry_compression GL_EXT_histogram GL_EXT_convolution
GL_HP_convolution_border_modes GL_SUN_convolution_border_modes
GL_EXT_blend_color GL_EXT_blend_minmax GL_EXT_blend_subtract
GL_EXT_pixel_transform GL_EXT_blend_logic_op GL_ARB_imaging
GL_HP_occlusion_test GL_SUN_triangle_list GL_SGIS_sharpen_texture
GL_SGIS_detail_texture GL_EXT_texture_filter_anisotropic
GL_SGIS_texture_border_clamp GL_ARB_texture_border_clamp
GL_ARB_texture_env_combine GL_EXT_texture_env_combine
GL_SGIS_texture_filter4 GL_SGIX_texture_lod_bias
GL_SGIX_texture_scale_bias GL_ARB_multitexture GL_SUN_mesh_array
GL_ARB_texture_env_dot3 GL_ARB_texture_env_add GL_ARB_texture_cube_map
GL_ARB_point_parameters

SDL_GL_RED_SIZE: requested 5, got 8
SDL_GL_GREEN_SIZE: requested 5, got 8
SDL_GL_BLUE_SIZE: requested 5, got 8
SDL_GL_DEPTH_SIZE: requested 16, got 28
SDL_GL_DOUBLEBUFFER: requested 1, got 1
app lost mouse focus
app gained mouse focus
key ‘q’ pressed

The reason I want to use the ggi driver is that if I use the x11 driver,
SDL thinks that there is no “hardware acceleration” available. Although,
as you see above, it does detect the Sun Elite 3D graphics board. I’m
confused about this.

Here is some further info:

bash-3.00$ export SDL_VIDEODRIVER=x11
Video driver: x11
Current display: 32 bits-per-pixel
Red Mask = 0x000000ff
Green Mask = 0x0000ff00
Blue Mask = 0x00ff0000
Fullscreen video modes:
1280x1024x32
A window manager is available
bash-3.00$ export SDL_VIDEODRIVER=ggi
bash-3.00$ testvidinfo
LibGGI: No explicit target specified.
LibGGI: Try to use display-x…
LibGGI: No explicit target specified.
LibGGI: Try to use display-x…
Video driver: ggi
Current display: 24 bits-per-pixel
Red Mask = 0x000000ff
Green Mask = 0x0000ff00
Blue Mask = 0x00ff0000
Fullscreen video modes:
1152x921x24
Hardware surfaces are available (4243968K video memory)
bash-3.00$

Any hints as to what is going on would be appreciated.

                            Kostas

export SDL_VIDEODRIVER=ggi

and then run the “testgl” program in the SDL distribution. I get:

bash-3.00$ testgl
LibGGI: No explicit target specified.
LibGGI: Try to use display-x…
LibGGI: No explicit target specified.
LibGGI: Try to use display-x…
GGI_SetVideoMode()
Couldn’t set GL mode: OpenGL not available
bash-3.00$

Now when I set

export SDL_VIDEODRIVER=x11,

I get

bash-3.00$ testgl
Screen BPP: 32

Vendor : Sun Microsystems, Inc.
Renderer : Elite-3D, VIS
Version : 1.3 Sun OpenGL 1.3patch 113886-05 for Solaris
Extensions : GL_EXT_texture3D GL_SGI_color_table

GL_ARB_point_parameters

SDL_GL_RED_SIZE: requested 5, got 8
SDL_GL_GREEN_SIZE: requested 5, got 8
SDL_GL_BLUE_SIZE: requested 5, got 8
SDL_GL_DEPTH_SIZE: requested 16, got 28
SDL_GL_DOUBLEBUFFER: requested 1, got 1
app lost mouse focus
app gained mouse focus
key ‘q’ pressed

The reason I want to use the ggi driver is that if I use the x11 driver,
SDL thinks that there is no “hardware acceleration” available. Although,
as you see above, it does detect the Sun Elite 3D graphics board. I’m
confused about this.

Here is some further info:

bash-3.00$ export SDL_VIDEODRIVER=x11
Video driver: x11
Current display: 32 bits-per-pixel
Red Mask = 0x000000ff
Green Mask = 0x0000ff00
Blue Mask = 0x00ff0000
Fullscreen video modes:
1280x1024x32
A window manager is available
bash-3.00$ export SDL_VIDEODRIVER=ggi
bash-3.00$ testvidinfo
LibGGI: No explicit target specified.
LibGGI: Try to use display-x…
LibGGI: No explicit target specified.
LibGGI: Try to use display-x…
Video driver: ggi
Current display: 24 bits-per-pixel
Red Mask = 0x000000ff
Green Mask = 0x0000ff00
Blue Mask = 0x00ff0000
Fullscreen video modes:
1152x921x24
Hardware surfaces are available (4243968K video memory)
bash-3.00$

What testvid reports is whether hardware 2D surfaces are available or not.
These are never available using the x11 backend. This doesn’t say anything
about the implementation of the OpenGL driver, since this is beyond SDL’s
scope.

So, the output from the testgl program suggests that you actually have
hardware accelerated OpenGL, using the x11 driver. I don’t know of any
other backend for linux supporting OpenGL.

I don’t know if the ggi backend actually gives real hardware surfaces or
if that only is what the SDL backend thinks it is. The amount of video
memory available somehow suggests that it isn’t really hardware
surfaces… Also, if ggi is layered upon x11, you probably don’t gain
anything on using that, it only adds another layer of abstraction.

// MartinOn Thu, 27 Oct 2005, Kostas Oikonomou wrote:

Martin Storsj? <martin martin.st> writes:

So, the output from the testgl program suggests that you actually have
hardware accelerated OpenGL, using the x11 driver. I don’t know of any
other backend for linux supporting OpenGL.

Thanks for the response.
It’s possible that I’ve missed it, but it seems to me that the SDL documentation
is very unclear about which back ends support OpenGL. Is that spelled out
somewhere?

I don’t know if the ggi backend actually gives real hardware surfaces or
if that only is what the SDL backend thinks it is.

Yes, I don’t understand what is really happening.

The amount of video memory available somehow suggests that it isn’t really
hardware surfaces…

Yes, I agree.

Also, if ggi is layered upon x11, you probably don’t gain
anything on using that, it only adds another layer of abstraction.

Right, I would not want ggi to be layered on top of x11. My purpose was to have
OpenGL, as well as “hardware acceleration” (indicated by the “hw_available” flag
in the SDL source). So the conclusion is:

  1. X11 works with OpenGL and the hw graphics accelerator.
  2. X11 doesn’t offer what SDL calls “hardware acceleration for 2D surfaces”.
  3. GGI doesn’t seem to work with OpenGL.
  4. GGI offers what SDL calls “hardware acceleration for 2D surfaces”.

Still confusing to me, but do you agree?

  Kostas

What testvid reports is whether hardware 2D surfaces are available or not.
These are never available using the x11 backend. This doesn’t say anything
about the implementation of the OpenGL driver, since this is beyond SDL’s
scope.

So, the output from the testgl program suggests that you actually have
hardware accelerated OpenGL, using the x11 driver. I don’t know of any
other backend for linux supporting OpenGL.

There is no other one.

I don’t know if the ggi backend actually gives real hardware surfaces or
if that only is what the SDL backend thinks it is. The amount of video
memory available somehow suggests that it isn’t really hardware
surfaces…

Actually, this number suspiciously looks like -1 casted to an unsigned :slight_smile:

Stephane

P? Fri, 28 Oct 2005 18:04:55 +0200, skrev Stephane Marchesin
<stephane.marchesin at wanadoo.fr>:

So, the output from the testgl program suggests that you actually have
hardware accelerated OpenGL, using the x11 driver. I don’t know of any
other backend for linux supporting OpenGL.

There is no other one.

Doesn’t DirectFB have some OpenGL support ? I’m not sure, but I think I
heard something about that a while back (the directfb site doesn’t respond,
so I can’t check). The SDL backend doesn’t support that in any case, of
course, but maybe it could be added.

  • Gerry

Thanks for the response.
It’s possible that I’ve missed it, but it seems to me that the SDL documentation
is very unclear about which back ends support OpenGL. Is that spelled out
somewhere?

Almost certainly: Windows, X11, Quartz (Mac OS X), maybe whatever MacOS
9 uses, and that’s it.

I highly doubt someone wrote the GL glue for GGI…I didn’t realize
anyone was still USING ggi.

Also, eventually GGI is going to use X11 under the hood…it would be
better to figure out what SDL doesn’t like about your X11 setup if you
only care about GGI to get an X11 GL context.

–ryan.

Gerry JJ wrote:

P? Fri, 28 Oct 2005 18:04:55 +0200, skrev Stephane Marchesin
<@Stephane_Marchesin>:

So, the output from the testgl program suggests that you actually have
hardware accelerated OpenGL, using the x11 driver. I don’t know of any
other backend for linux supporting OpenGL.

There is no other one.

Doesn’t DirectFB have some OpenGL support ? I’m not sure, but I think I
heard something about that a while back (the directfb site doesn’t respond,
so I can’t check). The SDL backend doesn’t support that in any case, of
course, but maybe it could be added.

Yes, DirectFB has OpenGL support. So does the framebuffer if you use
something like miniglx. But I was talking about SDL backends that
acutally implement the OpenGL features. And for linux, there is only x11.

Stephane