Jump to content

View more

Image of the Day

Boxes as reward for our ranking mode. ヾ(☆▽☆)
#indiedev #gamedev #gameart #screenshotsaturday https://t.co/ALF1InmM7K
IOTD | Top Screenshots

The latest, straight to your Inbox.

Subscribe to GameDev.net Direct to receive the latest updates and exclusive content.


Sign up now

Loading OpenGL textures in Windows from JPG

4: Adsense

Old topic!

Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.


  • You cannot reply to this topic
1 reply to this topic

#1 CaptainStiggz   Members   

100
Like
0Likes
Like

Posted 13 September 2011 - 05:37 PM

Hi,
I'm trying to load a jpg image into an OpenGL texture and having a miserable time of it. I'm using visual studio 2010, windows 7, so it's a real bastard to try and use most of the image libraries which provide this functionality. I've been trying to use the method described here:

http://nehe.gamedev...._loading/18007/

I'm able to get it to work in the example VS project provided, but can't figure out why it won't work in my own code. It's failing at this step:

hbmpTemp = CreateDIBSection(hdcTemp, &bi, DIB_RGB_COLORS, (void**)&pBits, 0, 0);

But there is no error message, it just doesn't work, making it tricky to debug. Any ideas?

Thanks,
Zach

#2 Caste   Members   

973
Like
0Likes
Like

Posted 27 October 2011 - 06:47 AM

Sorry about the late reply, but nevertheless a useful tip for texture loading:

Try using SOIL, a really easy to use library that allows you to load an broad variety of file formats: http://www.lonesock.net/soil.html

EDIT: I've added a small tutorial as extension to lesson 6: Texture loading with SOIL




Old topic!

Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.