35 for (
size_t ind = 0; ind <
s.objcnt; ind++) {
37 if (!rv ||
s.obj[ind]->common.layer >= rv->
common.
layer) {
38 if (
s.obj[ind]->common.functions.click)
175 s->base.common.width = (float)w;
176 s->base.common.height = (float)h;
183 s->base.common.compset =
s;
195 s->obj[
s->objcnt - 1] = obj;
203 glGetIntegerv(GL_VIEWPORT, vPort);
205 glMatrixMode(GL_PROJECTION);
210 glOrtho(0, vPort[2], 0, vPort[3], -1, 1);
211 glMatrixMode(GL_MODELVIEW);
216 glDisable(GL_DEPTH_TEST);
221 glMatrixMode(GL_PROJECTION);
223 glMatrixMode(GL_MODELVIEW);
225 glEnable(GL_DEPTH_TEST);
230 for (
size_t ind = 0; ind <
s->objcnt; ind++) {
231 s->obj[ind]->common.functions.draw(
s->obj[ind]);
238 if (w > 0 && h > 0) {
239 s->base.common.width = (float)w;
240 s->base.common.height = (float)h;
Memory allocation wrappers that exit on failure.
static void * gv_recalloc(void *ptr, size_t old_nmemb, size_t new_nmemb, size_t size)
static void * gv_alloc(size_t size)
#define GLCOMPSET_BORDERWIDTH
#define GLCOMP_DEFAULT_HEIGHT
void(* glcompmouseupfunc_t)(glCompObj *obj, float x, float y, glMouseButtonType t)
#define GLCOMP_DEFAULT_WIDTH
void(* glcompmousedownfunc_t)(glCompObj *obj, float x, float y, glMouseButtonType t)
#define GLCOMPSET_PANEL_COLOR_B
#define GLCOMPSET_PANEL_COLOR_G
#define GLCOMPSET_PANEL_COLOR_R
#define GLCOMPSET_PANEL_COLOR_ALPHA
glCompFont glNewFontFromParent(glCompObj *o, const char *text)
void glDeleteFont(glCompFont *f)
void glCompMouseInit(glCompMouse *m)
static int glCompPointInObject(glCompObj *p, float x, float y)
void glCompInitCommon(glCompObj *childObj, glCompObj *parentObj, float x, float y)
void glCompEmptyCommon(glCompCommon *c)
static glCompObj * glCompGetObjByMouse(glCompSet s, const glCompMouse m)
static void glCompMouseMove(glCompObj *obj, float x, float y)
void glCompSetDraw(glCompSet *s)
void glCompSetAddObj(glCompSet *s, glCompObj *obj)
void glCompDrawBegin(void)
glCompSet * glCompSetNew(int w, int h)
static void glCompSetMouseUp(void *obj, float x, float y, glMouseButtonType t)
static void glCompSetMouseDown(void *obj, float x, float y, glMouseButtonType t)
static void glCompSetMouseClick(void *obj, float x, float y, glMouseButtonType t)
void glcompsetUpdateBorder(glCompSet *s, int w, int h)
glcompmouseupfunc_t mouseup
glcompmousedownfunc_t mousedown
glcompmouseoverfunc_t mouseover
glCompCallBacks callbacks
glCompCallBacks functions
glCompFont font
font to use