p->pos.y=p->pos.y+p->panel->pos.y;
}
- fontSize (p->size);
+ fontSize ((int)p->size);
fontColorA (p->color.R,p->color.G,p->color.B,p->color.A);
- fontDrawString ( p->pos.x,p->pos.y,p->text,p->size*p->fontsizefactor*strlen(p->text));
+ fontDrawString ( (int)p->pos.x,(int)p->pos.y,p->text,(int)(p->size*p->fontsizefactor*strlen(p->text)));
if (p->panel)
{
p->pos.x=p->pos.x-p->panel->pos.x;
if (p->status==1)
{
color_fac=GLCOMPSET_BUTTON_BEVEL_BRIGHTNESS;
- glColor4f(p->color.R/1.2,p->color.G/1.2,p->color.B/1.2,p->color.A);
- p->thickness=p->thickness/1.2;
+ glColor4f(p->color.R/(GLfloat)1.2,p->color.G/(GLfloat)1.2,p->color.B/(GLfloat)1.2,p->color.A);
+ p->thickness=p->thickness/(GLfloat)1.2;
}
{
color_fac=1/GLCOMPSET_BUTTON_BEVEL_BRIGHTNESS;
glColor4f(p->color.R,p->color.G,p->color.B,p->color.A);
- p->thickness=p->thickness*1.2;
+ p->thickness=p->thickness*(GLfloat)1.2;
}
if (!p->hasglyph)
{
glVertex3f(p->pos.x+p->thickness,p->pos.y+p->height-p->thickness,p->bevel);
glEnd();
//draw caption
- fontx=(p->width-p->thickness*2-p->fontsize*strlen(p->caption)*GLCOMPSET_FONT_SIZE_FACTOR)/2.0+p->pos.x+p->thickness;
- fonty=(p->height-p->thickness*2-p->fontsize)/2.0+p->pos.y+p->thickness;
- fontSize (p->fontsize);
+ fontx=(p->width-p->thickness*(GLfloat)2-p->fontsize*strlen(p->caption)*GLCOMPSET_FONT_SIZE_FACTOR)/(GLfloat)2.0+p->pos.x+p->thickness;
+ fonty=(p->height-p->thickness*(GLfloat)2-p->fontsize)/(GLfloat)2.0+p->pos.y+p->thickness;
+ fontSize ((int)p->fontsize);
// fontColorA (p->fontcolor.R,p->fontcolor.B,p->fontcolor.G,p->fontcolor.A);
fontColorA (0,0,0,1);
- fontDrawString (fontx,fonty,p->caption,p->fontsize*strlen(p->caption)*GLCOMPSET_FONT_SIZE_FACTOR);
+ fontDrawString ((int)fontx,(int)fonty,p->caption,(int)(p->fontsize*strlen(p->caption)*GLCOMPSET_FONT_SIZE_FACTOR));
}
//put glyph
else
{
glEnable( GL_TEXTURE_2D );
- fontx=(p->width-p->thickness*2-p->glyphwidth)/2.0+p->pos.x+p->thickness;
- fonty=(p->height-p->thickness*2-p->glyphheight)/2.0+p->pos.y+p->thickness;
+ fontx=(p->width-p->thickness*(GLfloat)2-p->glyphwidth)/(GLfloat)2.0+p->pos.x+p->thickness;
+ fonty=(p->height-p->thickness*(GLfloat)2-p->glyphheight)/(GLfloat)2.0+p->pos.y+p->thickness;
glBindTexture( GL_TEXTURE_2D, p->glyph->id);
glColor4f(1,1,1,1);
glBegin(GL_QUADS);
{
int ind=0;
- printf("in release\n");
for (ind=0 ; ind < s->buttoncount; ind ++)
{
if((s->buttons[ind]->visible) && (s->buttons[ind]->enabled))
GLdouble posX, posY, posZ;
- int ind;
- GLdouble depth[5];
- GLdouble raster[5];
GLint viewport[4];
GLdouble modelview[16];
GLdouble projection[16];
GLfloat winX, winY;
- GLfloat winZ[36];
- char buffer [200];
float kts=1;
glGetDoublev( GL_MODELVIEW_MATRIX, modelview );
glGetDoublev( GL_PROJECTION_MATRIX, projection );
winY = (float)viewport[3] - (float)y;
gluUnProject( winX, winY, wwinZ, modelview, projection, viewport, &posX, &posY, &posZ);
- *X=posX;
- *Y=posY;
- *Z=posZ;
+ *X=(float)posX;
+ *Y=(float)posY;
+ *Z=(float)posZ;
}
//#include "gltemplate.h"
#include "glcomptexture.h"
-#define GLCOMPSET_PANEL_COLOR_R 0.16
-#define GLCOMPSET_PANEL_COLOR_G 0.44
-#define GLCOMPSET_PANEL_COLOR_B 0.87
-#define GLCOMPSET_PANEL_COLOR_ALPHA 0.5
-#define GLCOMPSET_PANEL_SHADOW_COLOR_R 0
-#define GLCOMPSET_PANEL_SHADOW_COLOR_G 0
-#define GLCOMPSET_PANEL_SHADOW_COLOR_B 0
-#define GLCOMPSET_PANEL_SHADOW_COLOR_A 0.3
-#define GLCOMPSET_PANEL_SHADOW_WIDTH 4
-
-#define GLCOMPSET_BUTTON_COLOR_R 0
-#define GLCOMPSET_BUTTON_COLOR_G 1
-#define GLCOMPSET_BUTTON_COLOR_B 0.3
-#define GLCOMPSET_BUTTON_COLOR_ALPHA 0.6
-#define GLCOMPSET_BUTTON_THICKNESS 3
-#define GLCOMPSET_BUTTON_BEVEL_BRIGHTNESS 1.7
-#define GLCOMPSET_FONT_SIZE 14
-#define GLCOMPSET_BUTTON_FONT_COLOR_R 1
-#define GLCOMPSET_BUTTON_FONT_COLOR_G 1
-#define GLCOMPSET_BUTTON_FONT_COLOR_B 1
-#define GLCOMPSET_BUTTON_FONT_COLOR_ALPHA 1
-#define GLCOMPSET_FONT_SIZE_FACTOR 0.7
-#define GLCOMPSET_LABEL_COLOR_R 0
-#define GLCOMPSET_LABEL_COLOR_G 0
-#define GLCOMPSET_LABEL_COLOR_B 0
-#define GLCOMPSET_LABEL_COLOR_ALPHA 1
-
-#define GLCOMPSET_PANEL_BEVEL 0.1
-#define GLCOMPSET_BEVEL_DIFF 0.001
+#define GLCOMPSET_PANEL_COLOR_R (GLfloat)0.16
+#define GLCOMPSET_PANEL_COLOR_G (GLfloat)0.44
+#define GLCOMPSET_PANEL_COLOR_B (GLfloat)0.87
+#define GLCOMPSET_PANEL_COLOR_ALPHA (GLfloat)0.5
+#define GLCOMPSET_PANEL_SHADOW_COLOR_R (GLfloat)0
+#define GLCOMPSET_PANEL_SHADOW_COLOR_G (GLfloat)0
+#define GLCOMPSET_PANEL_SHADOW_COLOR_B (GLfloat)0
+#define GLCOMPSET_PANEL_SHADOW_COLOR_A (GLfloat)0.3
+#define GLCOMPSET_PANEL_SHADOW_WIDTH (GLfloat)4
+
+#define GLCOMPSET_BUTTON_COLOR_R (GLfloat)0
+#define GLCOMPSET_BUTTON_COLOR_G (GLfloat)1
+#define GLCOMPSET_BUTTON_COLOR_B (GLfloat)0.3
+#define GLCOMPSET_BUTTON_COLOR_ALPHA (GLfloat)0.6
+#define GLCOMPSET_BUTTON_THICKNESS (GLfloat)3
+#define GLCOMPSET_BUTTON_BEVEL_BRIGHTNESS (GLfloat)1.7
+#define GLCOMPSET_FONT_SIZE (GLfloat)14
+#define GLCOMPSET_BUTTON_FONT_COLOR_R (GLfloat)1
+#define GLCOMPSET_BUTTON_FONT_COLOR_G (GLfloat)1
+#define GLCOMPSET_BUTTON_FONT_COLOR_B (GLfloat)1
+#define GLCOMPSET_BUTTON_FONT_COLOR_ALPHA (GLfloat)1
+#define GLCOMPSET_FONT_SIZE_FACTOR (GLfloat)0.7
+#define GLCOMPSET_LABEL_COLOR_R (GLfloat)0
+#define GLCOMPSET_LABEL_COLOR_G (GLfloat)0
+#define GLCOMPSET_LABEL_COLOR_B (GLfloat)0
+#define GLCOMPSET_LABEL_COLOR_ALPHA (GLfloat)1
+
+#define GLCOMPSET_PANEL_BEVEL (GLfloat)0.1
+#define GLCOMPSET_BEVEL_DIFF (GLfloat)0.001
typedef void (*callbackfunc_t)(void* component);
int glCompLabelSetText(glCompLabel* p,char* text);
int glCompPanelHide(glCompPanel* p);
int glCompPanelShow(glCompPanel* p);
+int glCompSetDrawPanels(glCompSet* s);
#endif
// if wrap is true, the texture wraps over at the edges (repeat)
// ... false, the texture ends at the edges (clamp)
glTexParameterf( GL_TEXTURE_2D, GL_TEXTURE_WRAP_S,
- wrap ? GL_REPEAT : GL_CLAMP );
+ (GLfloat)wrap ? (GLfloat)GL_REPEAT : GL_CLAMP );
glTexParameterf( GL_TEXTURE_2D, GL_TEXTURE_WRAP_T,
- wrap ? GL_REPEAT : GL_CLAMP );
+ (GLfloat)wrap ? (GLfloat)GL_REPEAT : GL_CLAMP );
/* glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S,GL_REPEAT );
glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT);
// free buffer
free( data );
- t->w=width;
- t->h=height;
+ t->w=(float)width;
+ t->h=(float)height;
return t;
}
int glCompDeleteTexture(glCompTexture* t)
GLdouble posX, posY, posZ;
- int ind;
- GLdouble depth[5];
- GLdouble raster[5];
GLint viewport[4];
GLdouble modelview[16];
GLdouble projection[16];
GLfloat winX, winY;
- GLfloat winZ[36];
- char buffer [200];
float kts=1;
//glTranslatef (0.0,0.0,0.0);
glGetDoublev( GL_MODELVIEW_MATRIX, modelview );
winY = (float)viewport[3] - (float)y;
gluUnProject( winX, winY, wwinZ, modelview, projection, viewport, &posX, &posY, &posZ);
- *X=posX;
- *Y=posY;
- *Z=posZ;
+ *X=(float)posX;
+ *Y=(float)posY;
+ *Z=(float)posZ;
return 1;
}
{
int x,y;
- float* X,Y, Z;
GLdouble wwinX;
GLdouble wwinY;
GLdouble wwinZ;
GLdouble posXX, posYY, posZZ;
- int ind;
- GLdouble depth[5];
- GLdouble raster[5];
GLint viewport[4];
GLdouble modelview[16];
GLdouble projection[16];
GLfloat winX, winY;
- GLfloat winZ[36];
- char buffer [200];
float kts=1;
//glTranslatef (0.0,0.0,0.0);
glGetDoublev( GL_MODELVIEW_MATRIX, modelview );
winX = (float)x;
winY = (float)viewport[3] - (float)y;
gluUnProject( winX, winY, wwinZ, modelview, projection, viewport, &posXX, &posYY, &posZZ);
- printf ("return value:%f\n:",((float)posXX-(float)posX));
return ((float)(posXX-posX));
}