35 for (
size_t ind = 0; ind <
s->objcnt; ind++) {
36 if (
s->obj[ind]->common.visible
38 if (!rv ||
s->obj[ind]->common.layer >= rv->
common.
layer) {
39 if (
s->obj[ind]->common.functions.click)
57 if (((
glCompSet *) obj)->common.callbacks.mouseover)
58 ((
glCompSet *) obj)->common.callbacks.mouseover(obj, x, y);
64 if (((
glCompSet *) obj)->common.callbacks.click)
65 ((
glCompSet *) obj)->common.callbacks.click(obj, x, y, t);
80 common.compset))->mouse);
81 if (((
glCompSet *) obj)->mouse.clickedObj)
82 if (((
glCompSet *) obj)->mouse.clickedObj->common.functions.
84 ((
glCompSet *) obj)->mouse.clickedObj->common.functions.
85 mousedown(((
glCompSet *) obj)->mouse.clickedObj, x, y,
91 if (((
glCompSet *) obj)->common.callbacks.mousedown)
92 ((
glCompSet *) obj)->common.callbacks.mousedown(obj, x, y, t);
97 float tempY = ((
glCompObj *) obj)->common.height - y;
103 ((
glCompSet *) obj)->mouse.pos.x = tempX;
104 ((
glCompSet *) obj)->mouse.pos.y = tempY;
113 if (((
glCompSet *) obj)->common.callbacks.mouseup)
114 ((
glCompSet *) obj)->common.callbacks.mouseup(obj, x, y, t);
192 s->common.width = (float)w;
193 s->common.height = (float)h;
199 s->common.compset =
s;
211 s->obj[
s->objcnt - 1] = obj;
219 glGetIntegerv(GL_VIEWPORT, vPort);
221 glMatrixMode(GL_PROJECTION);
226 glOrtho(0, vPort[2], 0, vPort[3], -1, 1);
227 glMatrixMode(GL_MODELVIEW);
232 glDisable(GL_DEPTH_TEST);
237 glMatrixMode(GL_PROJECTION);
239 glMatrixMode(GL_MODELVIEW);
241 glEnable(GL_DEPTH_TEST);
246 for (
size_t ind = 0; ind <
s->objcnt; ind++) {
247 s->obj[ind]->common.functions.draw(
s->obj[ind]);
254 if (w > 0 && h > 0) {
255 s->common.width = (float)w;
256 s->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(* glcompmouseoverfunc_t)(glCompObj *obj, float x, float y)
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, 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, glCompMouse *m)
static void glCompMouseMove(void *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)
glcompdoubleclickfunc_t doubleclick
glcompmouseoutfunc_t mouseout
glcompmouseupfunc_t mouseup
glcompmouseinfunc_t mousein
glcompmousedownfunc_t mousedown
glcompmouseoverfunc_t mouseover
glCompCallBacks callbacks
glCompCallBacks functions