Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 46630 - ARB vertex program / fragment program Extensions fail to load in SDL
Summary: ARB vertex program / fragment program Extensions fail to load in SDL
Status: RESOLVED INVALID
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Library (show other bugs)
Hardware: x86 Linux
: High normal
Assignee: Gentoo Games
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-04-02 12:12 UTC by James Urquhart
Modified: 2004-07-06 03:26 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments
Test Program (test_gl_shader.tar.gz,2.33 KB, application/octet-stream)
2004-04-02 12:14 UTC, James Urquhart
Details

Note You need to log in before you can comment on or make changes to this bug.
Description James Urquhart 2004-04-02 12:12:56 UTC
I am attempting to use the ARB vertex program and ARB fragment program extensions in SDL (ARB_vertex_program and ARB_fragment_program).
A quick look at glxinfo confirms my card (geforce fx 5200) supports these extensions :

jurquhart@genty jurquhart $ glxinfo |grep _program,
    GL_ARB_depth_texture, GL_ARB_fragment_program, GL_ARB_imaging,
    GL_ARB_vertex_buffer_object, GL_ARB_vertex_program, GL_ARB_window_pos,
    GL_NV_float_buffer, GL_NV_fog_distance, GL_NV_fragment_program,
    GL_NV_vertex_array_range, GL_NV_vertex_array_range2, GL_NV_vertex_program,

On an additional note, i am using the latest unstable gentoo.
This does not appear to happen on non-gentoo systems, so i suspect there is a problem with gentoo somewhere.

Reproducible: Always
Steps to Reproduce:
1. Download the test program
2. Run test_run.sh
3. Note results

Actual Results:  
Using the extension with GLUT works.
Using the extension with SDL fails. It cannot get the proc address! (via
SDL_GL_GetProcAddress())

See the "my_output" file in the attatched test program archive for the output i get.

Expected Results:  
SDL_GL_GetProcAddress() should have returned the ARB shader extension functions.

output from "glxinfo |grep _program," :
    GL_ARB_depth_texture, GL_ARB_fragment_program, GL_ARB_imaging,
    GL_ARB_vertex_buffer_object, GL_ARB_vertex_program, GL_ARB_window_pos,
    GL_NV_float_buffer, GL_NV_fog_distance, GL_NV_fragment_program,
    GL_NV_vertex_array_range, GL_NV_vertex_array_range2, GL_NV_vertex_program,

'emerge info' :
Portage 2.0.50-r1 (default-x86-2004.0, gcc-3.3.3, glibc-2.3.3_pre20040207-r0,
2.6.5-rc2)
=================================================================
System uname: 2.6.5-rc2 i686 AMD Athlon(tm) XP 2000+
Gentoo Base System version 1.4.3.13p1
Autoconf: sys-devel/autoconf-2.59-r3
Automake: sys-devel/automake-1.8.3
ACCEPT_KEYWORDS="x86 ~x86"
AUTOCLEAN="yes"
CFLAGS="-march=athlon-xp -O3 -pipe -msse -ffast-math -fomit-frame-pointer -mmmx
-m3dnow -mfpmath=sse -Wall -fexpensive-optimizations -funroll-loops
-frerun-loop-opt -frerun-cse-after-loop -falign-functions=16 -falign-labels=1
-foptimize-sibling-calls -fstrength-reduce -fprefetch-loop-arrays"
CHOST="i686-pc-linux-gnu"
COMPILER="gcc3"
CONFIG_PROTECT="/etc /usr/X11R6/lib/X11/xkb /usr/kde/2/share/config
/usr/kde/3.2/share/config /usr/kde/3/share/config /usr/lib/mozilla/defaults/pref
/usr/share/config /var/qmail/control"
CONFIG_PROTECT_MASK="/etc/gconf /etc/terminfo /etc/env.d"
CXXFLAGS="-march=athlon-xp -O3 -pipe -msse -ffast-math -fomit-frame-pointer
-mmmx -m3dnow -mfpmath=sse -Wall -fexpensive-optimizations -funroll-loops
-frerun-loop-opt -frerun-cse-after-loop -falign-functions=16 -falign-labels=1
-foptimize-sibling-calls -fstrength-reduce -fprefetch-loop-arrays"
DISTDIR="/usr/portage/distfiles"
FEATURES="autoaddcvs buildpkg ccache distcc sandbox"
GENTOO_MIRRORS="http://212.219.247.15/sites/www.ibiblio.org/gentoo/
http://212.219.247.10/sites/www.ibiblio.org/gentoo/
http://212.219.247.14/sites/www.ibiblio.org/gentoo/
http://212.219.247.12/sites/www.ibiblio.org/gentoo/"
MAKEOPTS="-j2"
PKGDIR="/usr/portage/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY=""
SYNC="rsync://rsync.gentoo.org/gentoo-portage"
USE="X alsa apache2 apm arts avi berkdb cdr cjk crypt cups dedicated dga doc dvd
dvdr encode esd flac foomaticdb gdbm gif gnome gpm gstreamer gtk gtk2 guile
imagemagick imlib ipv6 jpeg kde lcms libg++ libwww mad memlimit mikmod mmx motif
mozilla mpeg mysql ncurses nls oggvorbis opengl oss pam pdflib perl png python
qt quicktime readline samba sdl slang speex spell ssl subversion svga svn tcpd
threads tiff truetype usb x86 xinerama xml2 xmms xv zlib"
Comment 1 James Urquhart 2004-04-02 12:14:18 UTC
Created attachment 28590 [details]
Test Program

This is the test program which reveals the bug.
Comment 2 Mr. Bones. (RETIRED) gentoo-dev 2004-07-06 03:26:04 UTC
Thanks to Jon Atkins for helping me with this.

The problem is in your code. You need to add a SDL_SetVideoMode(...., SDL_OPENGL);
to the SDL portion of your test code.  This will give the SDL_GL_GetProcAddress function the context it needs to get the function addresses.