Skip to content

Latest commit

 

History

History
23 lines (16 loc) · 721 Bytes

README.md

File metadata and controls

23 lines (16 loc) · 721 Bytes

Hello Cube

This is a simple Android application I wrote to learn the basics of OpenGL ES 2.0. It renders a spinning cube with both texture and normal maps in a perspective projection.

Screenshot

Texture Format

I developed a simple, custom texture format that is simple to load via OpenGL. It is as follows:

typedef struct _tex_hdr {
	uint32_t width, height;
	uint32_t format, type;
} tex_hdr;

typedef struct _tex {
	tex_hdr header;
	void *data;
} tex;

data is the image bitmap data, which is in the format specified in the header. E.g., RGBA, float. I use a simple conversion utility (png2tex) to convert PNG files to this format.