Creating a OpenGL texture from a resource file

Started by
2 comments, last by Gandalf 23 years, 10 months ago
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
Gandalf the Black
Advertisement
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...
Ries
Interesting thought.. Have you tried that?

Gandalf the White

Gandalf the Black
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[] = { .... };
Ries

This topic is closed to new replies.

Advertisement