OpenGL textures

Member
Posts: 35
Joined: 2008.06
Post: #1
Does anyone know why a OpenGL ES texture of a size 32x32 with transparent areas shows up like a bunch of noise, while the same texture at 64x64 renders fine ?
Quote this message in a reply
Sage
Posts: 1,482
Joined: 2002.09
Post: #2
Do you have a picture? How are you loading it?

Scott Lembcke - Howling Moon Software
Author of Chipmunk Physics - A fast and simple rigid body physics library in C.
Quote this message in a reply
Member
Posts: 35
Joined: 2008.06
Post: #3
I added this guy after creating the context, and it clears up the goop. Smile

CGContextClearRect(ctx, CGRectMake(0, 0, width, height));
Quote this message in a reply
Luminary
Posts: 5,143
Joined: 2002.04
Post: #4
Using calloc rather than malloc to allocate the backing for the CGBitmapContext would achieve the same thing, possibly faster...
Quote this message in a reply
Sage
Posts: 1,482
Joined: 2002.09
Post: #5
Actually that was to be my guess. If you followed the Apple sample code, they don't tell you to clear the memory first. I had to find that out the hard way.

Scott Lembcke - Howling Moon Software
Author of Chipmunk Physics - A fast and simple rigid body physics library in C.
Quote this message in a reply
Member
Posts: 35
Joined: 2008.06
Post: #6
Thanks for you help.
Yep', calloc does just as well.
Quote this message in a reply
Post Reply 

Possibly Related Threads...
Thread: Author Replies: Views: Last Post
  OpenGL ES Textures Start White demonpants 5 6,905 Sep 3, 2009 06:40 AM
Last Post: Skorche
  opengl es font textures? cool mr croc 0 2,353 Aug 17, 2009 04:52 AM
Last Post: cool mr croc
  OpenGL ES Loading Textures soulstorm 5 6,656 May 25, 2009 07:21 AM
Last Post: soulstorm
  OpenGL textures upside down? orbian 1 9,067 Mar 13, 2009 02:53 PM
Last Post: ThemsAllTook
  blitting tiled textures using openGL jaguard 6 4,296 Jan 12, 2009 05:16 AM
Last Post: jaguard