mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-27 14:50:10 +01:00
make tiles a little smaller so they're all visible
This commit is contained in:
parent
9e385282fc
commit
d545d916a8
1 changed files with 11 additions and 10 deletions
|
|
@ -1,4 +1,4 @@
|
|||
/* $Id: texwrap.c,v 1.7 2003/09/02 19:25:18 idr Exp $ */
|
||||
/* $Id: texwrap.c,v 1.8 2005/08/25 03:09:12 brianp Exp $ */
|
||||
|
||||
/*
|
||||
* Test texture wrap modes.
|
||||
|
|
@ -38,6 +38,7 @@ static GLubyte BorderImage[SIZE+2][SIZE+2][4];
|
|||
static GLubyte NoBorderImage[SIZE][SIZE][4];
|
||||
static GLuint Border = 0;
|
||||
|
||||
#define TILE_SIZE 110
|
||||
|
||||
#define WRAP_MODE(m) { m , # m, GL_TRUE, 1.0, { NULL, NULL } }
|
||||
#define WRAP_EXT(m,e1,e2,v) { m , # m, GL_FALSE, v, { e1, e2 } }
|
||||
|
|
@ -65,12 +66,12 @@ static struct wrap_mode modes[] = {
|
|||
WRAP_EXT ( GL_MIRROR_CLAMP_EXT, "GL_ATI_texture_mirror_once",
|
||||
"GL_EXT_texture_mirror_clamp",
|
||||
999.0 ),
|
||||
WRAP_EXT ( GL_MIRROR_CLAMP_TO_EDGE_EXT, "GL_ATI_texture_mirror_once",
|
||||
"GL_EXT_texture_mirror_clamp",
|
||||
999.0 ),
|
||||
WRAP_EXT ( GL_MIRROR_CLAMP_TO_BORDER_EXT, "GL_EXT_texture_mirror_clamp",
|
||||
NULL,
|
||||
999.0 ),
|
||||
WRAP_EXT ( GL_MIRROR_CLAMP_TO_EDGE_EXT, "GL_ATI_texture_mirror_once",
|
||||
"GL_EXT_texture_mirror_clamp",
|
||||
999.0 ),
|
||||
{ 0 }
|
||||
};
|
||||
|
||||
|
|
@ -144,8 +145,8 @@ static void Display( void )
|
|||
}
|
||||
|
||||
/* loop over border modes */
|
||||
for (j = 0; j < modes[j].mode != 0; j++) {
|
||||
const GLfloat x0 = 0, y0 = 0, x1 = 140, y1 = 140;
|
||||
for (j = 0; modes[j].mode != 0; j++) {
|
||||
const GLfloat x0 = 0, y0 = 0, x1 = (TILE_SIZE - 10), y1 = (TILE_SIZE - 10);
|
||||
const GLfloat b = 1.2;
|
||||
const GLfloat s0 = -b, t0 = -b, s1 = 1.0+b, t1 = 1.0+b;
|
||||
|
||||
|
|
@ -156,7 +157,7 @@ static void Display( void )
|
|||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, modes[j].mode);
|
||||
|
||||
glPushMatrix();
|
||||
glTranslatef(offset * 150 + 10, i * 150 + 40, 0);
|
||||
glTranslatef(offset * TILE_SIZE + 10, i * TILE_SIZE + 40, 0);
|
||||
offset++;
|
||||
|
||||
glEnable(GL_TEXTURE_2D);
|
||||
|
|
@ -185,9 +186,9 @@ static void Display( void )
|
|||
glDisable(GL_TEXTURE_2D);
|
||||
glColor3f(1, 1, 1);
|
||||
offset = 0;
|
||||
for (i = 0; i < modes[i].mode != 0; i++) {
|
||||
for (i = 0; modes[i].mode != 0; i++) {
|
||||
if ( modes[i].supported ) {
|
||||
glWindowPos2iARB( offset * 150 + 10, 5 + ((offset & 1) * 15) );
|
||||
glWindowPos2iARB( offset * TILE_SIZE + 10, 5 + ((offset & 1) * 15) );
|
||||
PrintString(modes[i].name);
|
||||
offset++;
|
||||
}
|
||||
|
|
@ -291,7 +292,7 @@ int main( int argc, char *argv[] )
|
|||
{
|
||||
glutInit( &argc, argv );
|
||||
glutInitWindowPosition( 0, 0 );
|
||||
glutInitWindowSize( 800, 355 );
|
||||
glutInitWindowSize( 1000, 270 );
|
||||
glutInitDisplayMode( GLUT_RGB | GLUT_DOUBLE );
|
||||
glutCreateWindow(argv[0]);
|
||||
glutReshapeFunc( Reshape );
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue