[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Problem with RGBA Texture in GLX
- To: linuxgames@sunsite.dk
- Subject: Re: Problem with RGBA Texture in GLX
- From: Steve Baker <sjbaker1@airmail.net>
- Date: Sun, 06 Oct 2002 10:11:14 -0500
- Delivered-To: archiver@seul.org
- Delivered-To: mailing list linuxgames@sunsite.dk
- Delivery-Date: Sun, 06 Oct 2002 11:17:09 -0400
- Mailing-List: contact linuxgames-help@sunsite.dk; run by ezmlm
- Organization: Steve at Home
- References: <17347.1033903923@www14.gmx.net>
- Reply-To: linuxgames@sunsite.dk
- User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.0.0) Gecko/20020529
Nathi-huesken@gmx.de wrote:
> I am using GLX to open an OpenGL window.
> Everything works finde, as long, as I Create Textures
> using:
>
> glTexImage2D(GL_TEXTURE_2D,0,GL_RGB,Width,Height,0,GL_RGBA,GL_UNSIGNED_BYTE,Data);
>
> But that way I do not have an Alpha-Channel in my Textures (which I need!).
> When I try using GL_RGBA or GL_RGB5_A1 instead of the GL_RGB I get the
> following error:
>
> Program received signal SIGSEGV, Segmentation fault.
> [Switching to Thread 1024 (LWP 485)]
> 0x404891d3 in __nvsym04304 () from /usr/lib/libGLcore.so.1
>
> (That is the output ddd/gdb gave me, if I am just running the Prgramm I get
> an simple Segmentation Fault).
It's impossible to tell what you are doing wrong without some more information.
Your glTexImage2D command seems perfect to me.
Most likely, your 'Data' array isn't sized correctly. In this case, it should
be Width*Height*4 bytes long.
Try this:
{
unsigned char FakeData [ Width * Height * 4 ] ;
glTexImage2D(GL_TEXTURE_2D,0,GL_RGBA,Width,Height,0,GL_RGBA,GL_UNSIGNED_BYTE,FakeData);
}
...in place of the glTexImage2D command you have now. Does it still crash?
Can you show us more of your program?
----------------------------- Steve Baker -------------------------------
Mail : <sjbaker1@airmail.net> WorkMail: <sjbaker@link.com>
URLs : http://www.sjbaker.org
http://plib.sf.net http://tuxaqfh.sf.net http://tuxkart.sf.net
http://prettypoly.sf.net http://freeglut.sf.net
http://toobular.sf.net http://lodestone.sf.net