Archived

This topic is now archived and is closed to further replies.

Gandalf

Creating a OpenGL texture from a resource file

Recommended Posts

Can somebody show me how to read a bitmap from a resource file and create a texture from it in OpenGL? (The thing is I don´t want to read the bitmap from disk) Thanks, Gandalf the White

Share this post


Link to post
Share on other sites
how about writing a BMP to H

a small app that converts the bitmap to a includeable header

bmp ->
#ifndef BITMAPS_INCLUDED
#define BITMAPS_INCLUDED

static unsigned char bitmap[] = { 255, 33, 55, 32, ...... };

#endif

its not what you asked for, but it does the job...

Share this post


Link to post
Share on other sites
no, but it will surely work if you write your app correct. Or download one of those already programmed. I dont know any links.
=(

just store the resx, resy, data and maybe data format if you intent to use multiple formats ( like data is RGB, RGBA, A )

const char bitmap_0_type = TYPE_RGB; // defined by you
const int bitmap_0_sizex = 256;
const int bitmap_0_sizey = 256;
const unsigned char bitmap_0_data[] = { .... };

Share this post


Link to post
Share on other sites