1

I am trying to create a texture for my 3D models. It works fine as long that I just load the image file. I am using Microsoft Visual C++ 2008 Express, and I have been searching for a solution on this "problem", loading a .tga from resource into my project, and use it as an OpenGL texture.

//resource.h
#define TEST_TGA 201

//resource.rc
TEST_TGA TGA "test.tga"

I don't know if I actually can do this? But I really having a hard time finding any articles or topics about this.

Peter O.
  • 32,158
  • 14
  • 82
  • 96
techbech
  • 3,754
  • 5
  • 20
  • 28

1 Answers1

2

You could use stb_image library to load TGA images among other formats. You should be able to get the resource data with Windows API functions such as LoadResource. Check this answer for example code on loading binary resources.

Community
  • 1
  • 1
msell
  • 2,168
  • 13
  • 30