58 object->id = screen->
curId++;
60 image = &(
object->u.image);
93 if (curObject != NULL) {
95 curObject = curObject->
next;
96 if (curObject->
id ==
id) {
98 image = &(curObject->
u.
image);
104 }
while (curObject != screen->
objects);
125 glEnable(GL_TEXTURE_2D);
126 glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE);
127 glBindTexture(GL_TEXTURE_2D, image->
texture);
129 glBegin(GL_TRIANGLE_STRIP);
131 glColor4f(1.0, 1.0, 1.0, 0.0);
132 glTexCoord2f(0.0, 0.0); glVertex2f(obj->
xmin, obj->
ymin);
133 glTexCoord2f(0.0, 1.0); glVertex2f(obj->
xmin, obj->
ymax);
134 glTexCoord2f(1.0, 0.0); glVertex2f(obj->
xmax, obj->
ymin);
135 glTexCoord2f(1.0, 1.0); glVertex2f(obj->
xmax, obj->
ymax);
138 glBindTexture(GL_TEXTURE_2D, 0);
139 glDisable(GL_TEXTURE_2D);
void GfImgFreeTex(GLuint tex)
Free the texture.
GLuint GfImgReadTex(char *filename)
Read a png image into a texture.
void gfuiDrawImage(tGfuiObject *obj)
void GfuiStaticImageSet(void *scr, int id, char *name)
Replace an image by another one.
The Gaming Framework API (client part).
int GfuiStaticImageCreate(void *scr, int x, int y, int w, int h, char *name)
Create a new static image.
void gfuiAddObject(tGfuiScreen *screen, tGfuiObject *object)
void gfuiReleaseImage(tGfuiObject *obj)