Esempio n. 1
0
void display(void)
{
	const float slotSize = 30.f;
	const float slotColor[] = {0.8f, 0.8f, 0.8f};
	const float slotShadowSize = 2.0f;
	const float slotShadowAlpha = 0.7;

	glClear (GL_COLOR_BUFFER_BIT);
	glColor3f (1.0, 1.0, 1.0);

	glMatrixMode(GL_PROJECTION);
	glLoadIdentity();
	glOrtho(0, g_fWidth, 0, g_fHeight, 0, g_fDepth);
	glMatrixMode(GL_MODELVIEW);
	glLoadIdentity();

	glTranslatef(80.f, 80.f, 0.f);		//ÕûÌåƽÒÆ
	
	int xPos(0);
	int yPos(0);
	int xOffset(0);
	int yOffset(0);

	for (int i=0; i<16; i++)
	{
		char buffer[10] = {'\0'};
		itoa (i,buffer,10);

		int fontWidOffset = i>10 ? 12 : 5;		//¹ÀËãÁ¿
		int fontHghOffset = 10;					//¹ÀËãÁ¿

		int boxSize = 60;
		
		float colorVec[3];
		getColorFromTable(gColorStable[i], colorVec);
		glColor3fv(colorVec);
		RoundBoxRender::setType(i);

		yOffset = i/4;
		xOffset = i%4;

		glPushMatrix();
		{
			glTranslatef(xPos+xOffset*100, yPos+yOffset*100, 0.f);
			RoundBoxRender::gl_round_box_shade(GL_POLYGON, 0, 0, boxSize, boxSize, 10, 0.3, 0);
			glColor3f(0.f, 0.f, 0.0f);
			renderBitmapString2D(boxSize/2-fontWidOffset, boxSize/2-fontHghOffset, GLUT_BITMAP_TIMES_ROMAN_24, buffer);
		}glPopMatrix();
	}
	//glColor3f(1.0f, 1.0f, 0.0f);
	//ui_draw_link_bezier(&gRect);

	glutSwapBuffers();
}
Esempio n. 2
0
static inline bool setupBackupBmp(GifInfo* info)
{
	GifFileType* fGIF = info->gifFilePtr;
	info->backupPtr = calloc(fGIF->SWidth * fGIF->SHeight, sizeof(argb));
	if (!info->backupPtr)
	{
		info->gifFilePtr->Error = D_GIF_ERR_NOT_ENOUGH_MEM;
		return false;
	}
	argb paintingColor;
	getColorFromTable(fGIF->SBackGroundColor, &paintingColor, fGIF->SColorMap);
	eraseColor(info->backupPtr, fGIF->SWidth, fGIF->SHeight, paintingColor);
	return true;
}