PDA

View Full Version : Program Partially Renders



Dragonsoulj
02-06-2011, 02:59 PM
Hey Guys. I've been searching the internet for a while now trying to find an answer. The following program runs fine on my laptop I take to school, and all the commands and graphics work. However when I am on my tower, it breaks, doing what the attached screenshot shows. Moving over the options occasionally flickers what is missing, and clicking sometimes flickers what should be on the screen.

When working correctly, the default shape is a circle, which can be drawn to the screen (default color is white) centered on where you click, and can also be dragged. Changing shape or color should not clear the screen, but the clear screen menu option should. F1 exits, as well as the menu exit, and UP and DOWN change the size. These still work, but the drawing to the screen doesn't.

Tower is running an integrated ATI Radeon HD 3300 card, on Ubuntu 10.4. It is running the ATI driver (downloaded latest as of last night).

Laptop is running a NVIDIA GeForce 8400M GS , on Ubuntu 10.4. The driver is listed as current.


/*
* simple.c
* This program draws a white rectangle on a black background.
*/


#ifdef __APPLE__
#include <GLUT/glut.h>
#else
#include <GL/glut.h> /* glut.h includes gl.h and glu.h*/
#endif

#include <math.h>
#include <time.h>
#include <stdlib.h>

GLsizei wh = 500, ww = 500;
GLfloat size = 15.0;
int rainbow = 0;
GLfloat mult = 0.01;
void (*fnPtr)(int x, int y) = NULL;

void drawCircle(int x, int y)
{
y = wh - y;
glBegin(GL_POLYGON);
int theta = 0;
while(theta <= 360)
{
if(rainbow > 0)
{
glColor3f(mult * (rand() % 100), mult * (rand() % 100), mult * (rand() % 100));
}
float radian = theta * (M_PI / 180.0);
glVertex2f(size * cos(radian) + x, size * sin(radian) + y);
theta += 12;
}
glEnd();
glFlush();
}

void drawBox(int x, int y)

{
/* clear window */

/* glClear(GL_COLOR_BUFFER_BIT); */


/* draw unit square polygon */
y = wh - y;
glBegin(GL_POLYGON);
if(rainbow > 0)
{
glColor3f(mult * (rand() % 100), mult * (rand() % 100), mult * (rand() % 100));
}
glVertex2f(x-size,y-size);
if(rainbow > 0)
{
glColor3f(mult * (rand() % 100), mult * (rand() % 100), mult * (rand() % 100));
}
glVertex2f(x-size,y+size);
if(rainbow > 0)
{
glColor3f(mult * (rand() % 100), mult * (rand() % 100), mult * (rand() % 100));
}
glVertex2f(x+size,y+size);
if(rainbow > 0)
{
glColor3f(mult * (rand() % 100), mult * (rand() % 100), mult * (rand() % 100));
}
glVertex2f(x+size,y-size);
glEnd();

/* flush GL buffers */

glFlush();

}

void init()
{
srand((unsigned)time(0));
glViewport(0,0,ww,wh);
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
glOrtho(0.0,(GLdouble)ww,0.0,(GLdouble)wh,-1.0,1.0);
glClearColor(0.0,0.0,0.0,1.0);
glColor3f(1.0,1.0,1.0);
glClear(GL_COLOR_BUFFER_BIT);
glFlush();

/* set clear color to black */

/* glClearColor (0.0, 0.0, 0.0, 0.0); */
/* set fill color to white */

/* glColor3f(1.0, 1.0, 1.0); */

/* set up standard orthogonal view with clipping */
/* box as cube of side 2 centered at origin */
/* This is default view and these statement could be removed */

/* glMatrixMode (GL_PROJECTION);
glLoadIdentity ();
glOrtho(-1.0, 1.0, -1.0, 1.0, -1.0, 1.0); */
}

void display(void)

{
/* clear window */

glClear(GL_COLOR_BUFFER_BIT);


/* draw unit square polygon */

glBegin(GL_POLYGON);
glVertex2f(-0.5, -0.5);
glVertex2f(-0.5, 0.5);
glVertex2f(0.5, 0.5);
glVertex2f(0.5, -0.5);
glEnd();

/* flush GL buffers */

glFlush();

}

void myReshape(GLsizei w, GLsizei h)
{
/* adjust clipping box */
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
glOrtho(0.0, (GLdouble)w, 0.0, (GLdouble)h, -1.0,1.0);
glMatrixMode(GL_MODELVIEW);
glLoadIdentity();

/* adjust viewport and clear */
glViewport(0,0,w,h);
glClearColor(0.0,0.0,0.0,1.0);
glClear(GL_COLOR_BUFFER_BIT);
glFlush();

/* set global size for use by drawing routine */
ww = w;
wh = h;
}

void paint(int x, int y)
{
(*fnPtr)(x, y);
}

void mouse(int btn, int state, int x, int y)
{
/* if(btn==GLUT_RIGHT_BUTTON &amp;&amp; state == GLUT_DOWN) exit(0);*/
if(btn==GLUT_LEFT_BUTTON &amp;&amp; state == GLUT_DOWN)
{
if(fnPtr == NULL)
{
fnPtr = &amp;drawCircle;
}
paint(x,y);
}
}

void special(int key, int x, int y)
{
if(key == GLUT_KEY_F1) exit(0);
if(key == GLUT_KEY_UP)
{
if(size > 400)
{
size = 400;
}
else
{
size++;
}
}
if(key == GLUT_KEY_DOWN)
{
if(size < 1)
{
size = 1;
}
else
{
size--;
}
}
}

void colorMenu(int value)
{
switch(value)
{
case 1:
/* Red */
glColor3f(1.0,0.0,0.0);
break;
case 2:
/* Green */
glColor3f(0.0,1.0,0.0);
break;
case 3:
/* Blue */
glColor3f(0.0,0.0,1.0);
break;
case 4:
/* Orange */
glColor3f(1.0,0.5,0.0);
break;
case 5:
/* Purple */
glColor3f(0.5,0.0,0.5);
break;
case 6:
/* Yellow */
glColor3f(1.0,1.0,0.0);
break;
case 7:
/* Cyan */
glColor3f(0.0,1.0,1.0);
break;
case 8:
/* Magenta */
glColor3f(1.0,0.0,1.0);
break;
case 9:
/* Gray */
glColor3f(0.5,0.5,0.5);
break;
case 10:
/* Rainbow */
rainbow = 1;
break;
default:
/* White */
glColor3f(1.0,1.0,1.0);
break;
}
}

void mymenu(int value)
{
switch(value)
{
case 1: /* Change Color */
break;
case 2:
fnPtr = &amp;drawCircle;
break;
case 3:
fnPtr = &amp;drawBox;
break;
case 4:
glClear(GL_COLOR_BUFFER_BIT);
glFlush();
break;
case 5:
exit(0);
break;
default:
break;
}
}

int main(int argc, char** argv)
{

/* Initialize mode and open a window in upper left corner of screen */
/* Window title is name of program (arg[0]) */

glutInit(&amp;argc,argv);
glutInitDisplayMode (GLUT_SINGLE | GLUT_RGB);
glutInitWindowSize(500,500);
glutInitWindowPosition(0,0);
glutCreateWindow("simple");
/*glutDisplayFunc(display);*/
glutReshapeFunc(myReshape);
glutMouseFunc(mouse);
glutSpecialFunc(special);
init();
int sid = glutCreateMenu(colorMenu);
glutAddMenuEntry("Red", 1);
glutAddMenuEntry("Green", 2);
glutAddMenuEntry("Blue", 3);
glutAddMenuEntry("Orange", 4);
glutAddMenuEntry("Purple", 5);
glutAddMenuEntry("Yellow", 6);
glutAddMenuEntry("Cyan", 7);
glutAddMenuEntry("Magenta", 8);
glutAddMenuEntry("Gray", 9);
glutAddMenuEntry("Rainbow", 10);
glutAddMenuEntry("White", 9000);
int id = glutCreateMenu(mymenu);
glutAddSubMenu("Change Color", sid);
glutAddMenuEntry("Draw Circle", 2);
glutAddMenuEntry("Draw Box", 3);
glutAddMenuEntry("Clear Screen", 4);
glutAddMenuEntry("Exit", 5);
glutAttachMenu(GLUT_RIGHT_BUTTON);
glutMotionFunc(paint);
glutMainLoop();

}

Dragonsoulj
02-06-2011, 03:12 PM
Attached is the tower's glxinfo.

ZbuffeR
02-06-2011, 03:17 PM
Too bad I only see "You don't have permission to access /discussion_boards/attachments/182.txt on this server." when clicking your attachment ...

Dragonsoulj
02-06-2011, 03:19 PM
name of display: :0.0
display: :0 screen: 0
direct rendering: Yes
server glx vendor string: ATI
server glx version string: 1.4
server glx extensions:
GLX_ARB_multisample, GLX_EXT_import_context, GLX_EXT_texture_from_pixmap,
GLX_EXT_visual_info, GLX_EXT_visual_rating, GLX_OML_swap_method,
GLX_SGI_make_current_read, GLX_SGI_swap_control, GLX_SGIS_multisample,
GLX_SGIX_fbconfig, GLX_SGIX_pbuffer, GLX_SGIX_visual_select_group
client glx vendor string: ATI
client glx version string: 1.4
client glx extensions:
GLX_ARB_create_context, GLX_ARB_create_context_profile,
GLX_ARB_get_proc_address, GLX_ARB_multisample, GLX_EXT_import_context,
GLX_EXT_visual_info, GLX_EXT_visual_rating, GLX_MESA_allocate_memory,
GLX_MESA_swap_control, GLX_MESA_swap_frame_usage, GLX_NV_swap_group,
GLX_OML_swap_method, GLX_SGI_make_current_read, GLX_SGI_swap_control,
GLX_SGI_video_sync, GLX_SGIS_multisample, GLX_SGIX_fbconfig,
GLX_SGIX_pbuffer, GLX_SGIX_swap_barrier, GLX_SGIX_swap_group,
GLX_SGIX_visual_select_group, GLX_EXT_texture_from_pixmap,
GLX_EXT_framebuffer_sRGB, GLX_ARB_fbconfig_float
GLX version: 1.4
GLX extensions:
GLX_ARB_create_context, GLX_ARB_create_context_profile,
GLX_ARB_get_proc_address, GLX_ARB_multisample, GLX_EXT_import_context,
GLX_EXT_visual_info, GLX_EXT_visual_rating, GLX_MESA_swap_control,
GLX_NV_swap_group, GLX_OML_swap_method, GLX_SGI_make_current_read,
GLX_SGI_swap_control, GLX_SGI_video_sync, GLX_SGIS_multisample,
GLX_SGIX_fbconfig, GLX_SGIX_pbuffer, GLX_SGIX_swap_barrier,
GLX_SGIX_swap_group, GLX_SGIX_visual_select_group,
GLX_EXT_texture_from_pixmap
OpenGL vendor string: ATI Technologies Inc.
OpenGL renderer string: ATI Radeon HD 3300 Graphics
OpenGL version string: 3.2.9756 Compatibility Profile Context
OpenGL shading language version string: 1.50
OpenGL extensions:
GL_AMDX_name_gen_delete, GL_AMD_conservative_depth,
GL_AMD_draw_buffers_blend, GL_AMD_performance_monitor,
GL_AMD_shader_stencil_export, GL_ARB_color_buffer_float,
GL_ARB_copy_buffer, GL_ARB_depth_buffer_float, GL_ARB_depth_clamp,
GL_ARB_depth_texture, GL_ARB_draw_buffers, GL_ARB_draw_buffers_blend,
GL_ARB_draw_elements_base_vertex, GL_ARB_draw_instanced,
GL_ARB_fragment_coord_conventions, GL_ARB_fragment_program,
GL_ARB_fragment_program_shadow, GL_ARB_fragment_shader,
GL_ARB_framebuffer_object, GL_ARB_framebuffer_sRGB,
GL_ARB_geometry_shader4, GL_ARB_half_float_pixel,
GL_ARB_half_float_vertex, GL_ARB_imaging, GL_ARB_instanced_arrays,
GL_ARB_map_buffer_range, GL_ARB_multisample, GL_ARB_multitexture,
GL_ARB_occlusion_query, GL_ARB_pixel_buffer_object,
GL_ARB_point_parameters, GL_ARB_point_sprite, GL_ARB_provoking_vertex,
GL_ARB_seamless_cube_map, GL_ARB_shader_objects,
GL_ARB_shader_texture_lod, GL_ARB_shading_language_100, GL_ARB_shadow,
GL_ARB_shadow_ambient, GL_ARB_sync, GL_ARB_texture_border_clamp,
GL_ARB_texture_buffer_object, GL_ARB_texture_compression,
GL_ARB_texture_compression_rgtc, GL_ARB_texture_cube_map,
GL_ARB_texture_env_add, GL_ARB_texture_env_combine,
GL_ARB_texture_env_crossbar, GL_ARB_texture_env_dot3,
GL_ARB_texture_float, GL_ARB_texture_mirrored_repeat,
GL_ARB_texture_multisample, GL_ARB_texture_non_power_of_two,
GL_ARB_texture_rectangle, GL_ARB_texture_rg, GL_ARB_texture_snorm,
GL_ARB_transpose_matrix, GL_ARB_uniform_buffer_object,
GL_ARB_vertex_array_bgra, GL_ARB_vertex_array_object,
GL_ARB_vertex_buffer_object, GL_ARB_vertex_program, GL_ARB_vertex_shader,
GL_ARB_window_pos, GL_ATI_draw_buffers, GL_ATI_envmap_bumpmap,
GL_ATI_fragment_shader, GL_ATI_meminfo, GL_ATI_separate_stencil,
GL_ATI_texture_compression_3dc, GL_ATI_texture_env_combine3,
GL_ATI_texture_float, GL_ATI_texture_mirror_once, GL_EXT_abgr,
GL_EXT_bgra, GL_EXT_bindable_uniform, GL_EXT_blend_color,
GL_EXT_blend_equation_separate, GL_EXT_blend_func_separate,
GL_EXT_blend_minmax, GL_EXT_blend_subtract, GL_EXT_compiled_vertex_array,
GL_EXT_copy_buffer, GL_EXT_copy_texture, GL_EXT_draw_buffers2,
GL_EXT_draw_instanced, GL_EXT_draw_range_elements, GL_EXT_fog_coord,
GL_EXT_framebuffer_blit, GL_EXT_framebuffer_multisample,
GL_EXT_framebuffer_object, GL_EXT_framebuffer_sRGB,
GL_EXT_geometry_shader4, GL_EXT_gpu_program_parameters,
GL_EXT_gpu_shader4, GL_EXT_histogram, GL_EXT_multi_draw_arrays,
GL_EXT_packed_depth_stencil, GL_EXT_packed_float, GL_EXT_packed_pixels,
GL_EXT_pixel_buffer_object, GL_EXT_point_parameters,
GL_EXT_provoking_vertex, GL_EXT_rescale_normal, GL_EXT_secondary_color,
GL_EXT_separate_specular_color, GL_EXT_shadow_funcs, GL_EXT_stencil_wrap,
GL_EXT_subtexture, GL_EXT_texgen_reflection, GL_EXT_texture3D,
GL_EXT_texture_array, GL_EXT_texture_buffer_object,
GL_EXT_texture_buffer_object_rgb32, GL_EXT_texture_compression_latc,
GL_EXT_texture_compression_rgtc, GL_EXT_texture_compression_s3tc,
GL_EXT_texture_cube_map, GL_EXT_texture_edge_clamp,
GL_EXT_texture_env_add, GL_EXT_texture_env_combine,
GL_EXT_texture_env_dot3, GL_EXT_texture_filter_anisotropic,
GL_EXT_texture_integer, GL_EXT_texture_lod, GL_EXT_texture_lod_bias,
GL_EXT_texture_mirror_clamp, GL_EXT_texture_object,
GL_EXT_texture_rectangle, GL_EXT_texture_sRGB,
GL_EXT_texture_shared_exponent, GL_EXT_texture_snorm,
GL_EXT_texture_swizzle, GL_EXT_timer_query, GL_EXT_transform_feedback,
GL_EXT_vertex_array, GL_EXT_vertex_array_bgra,
GL_IBM_texture_mirrored_repeat, GL_KTX_buffer_region, GL_NV_blend_square,
GL_NV_conditional_render, GL_NV_copy_depth_to_color,
GL_NV_explicit_multisample, GL_NV_primitive_restart,
GL_NV_texgen_reflection, GL_SGIS_generate_mipmap,
GL_SGIS_texture_edge_clamp, GL_SGIS_texture_lod, GL_SUN_multi_draw_arrays,
GL_WIN_swap_hint, WGL_EXT_swap_control

65 GLX Visuals
visual x bf lv rg d st colorbuffer ax dp st accumbuffer ms cav
id dep cl sp sz l ci b ro r g b a bf th cl r g b a ns b eat
----------------------------------------------------------------------
0x23 24 tc 0 32 0 r y . 8 8 8 8 0 24 8 16 16 16 16 0 0 None
0x24 24 tc 0 32 0 r . . 8 8 8 8 0 24 8 16 16 16 16 0 0 None
0x25 24 tc 0 32 0 r y . 8 8 8 8 0 24 0 16 16 16 16 0 0 None
0x26 24 tc 0 32 0 r . . 8 8 8 8 0 24 0 16 16 16 16 0 0 None
0x27 24 tc 0 32 0 r y . 8 8 8 8 0 24 8 0 0 0 0 0 0 None
0x28 24 tc 0 32 0 r . . 8 8 8 8 0 24 8 0 0 0 0 0 0 None
0x29 24 tc 0 32 0 r y . 8 8 8 8 0 24 0 0 0 0 0 0 0 None
0x2a 24 tc 0 32 0 r . . 8 8 8 8 0 24 0 0 0 0 0 0 0 None
0x2b 24 tc 0 32 0 r y . 8 8 8 8 0 24 8 16 16 16 16 0 0 None
0x2c 24 tc 0 32 0 r . . 8 8 8 8 0 24 8 16 16 16 16 0 0 None
0x2d 24 tc 0 32 0 r y . 8 8 8 8 0 24 0 16 16 16 16 0 0 None
0x2e 24 tc 0 32 0 r . . 8 8 8 8 0 24 0 16 16 16 16 0 0 None
0x2f 24 tc 0 32 0 r y . 8 8 8 8 0 24 8 0 0 0 0 2 1 None
0x30 24 tc 0 32 0 r . . 8 8 8 8 0 24 8 0 0 0 0 2 1 None
0x31 24 tc 0 32 0 r y . 8 8 8 8 0 24 0 0 0 0 0 2 1 None
0x32 24 tc 0 32 0 r . . 8 8 8 8 0 24 0 0 0 0 0 2 1 None
0x33 24 tc 0 32 0 r y . 8 8 8 8 0 24 8 16 16 16 16 0 0 None
0x34 24 tc 0 32 0 r . . 8 8 8 8 0 24 8 16 16 16 16 0 0 None
0x35 24 tc 0 32 0 r y . 8 8 8 8 0 24 0 16 16 16 16 0 0 None
0x36 24 tc 0 32 0 r . . 8 8 8 8 0 24 0 16 16 16 16 0 0 None
0x37 24 tc 0 32 0 r y . 8 8 8 8 0 24 8 0 0 0 0 4 1 None
0x38 24 tc 0 32 0 r . . 8 8 8 8 0 24 8 0 0 0 0 4 1 None
0x39 24 tc 0 32 0 r y . 8 8 8 8 0 24 0 0 0 0 0 4 1 None
0x3a 24 tc 0 32 0 r . . 8 8 8 8 0 24 0 0 0 0 0 4 1 None
0x3b 24 tc 0 32 0 r y . 8 8 8 8 0 24 8 16 16 16 16 0 0 None
0x3c 24 tc 0 32 0 r . . 8 8 8 8 0 24 8 16 16 16 16 0 0 None
0x3d 24 tc 0 32 0 r y . 8 8 8 8 0 24 0 16 16 16 16 0 0 None
0x3e 24 tc 0 32 0 r . . 8 8 8 8 0 24 0 16 16 16 16 0 0 None
0x43 24 tc 0 32 0 r y . 8 8 8 8 0 24 8 16 16 16 16 0 0 None
0x44 24 tc 0 32 0 r . . 8 8 8 8 0 24 8 16 16 16 16 0 0 None
0x45 24 tc 0 32 0 r y . 8 8 8 8 0 24 0 16 16 16 16 0 0 None
0x46 24 tc 0 32 0 r . . 8 8 8 8 0 24 0 16 16 16 16 0 0 None
0x4b 24 dc 0 32 0 r y . 8 8 8 8 0 24 8 16 16 16 16 0 0 None
0x4c 24 dc 0 32 0 r . . 8 8 8 8 0 24 8 16 16 16 16 0 0 None
0x4d 24 dc 0 32 0 r y . 8 8 8 8 0 24 0 16 16 16 16 0 0 None
0x4e 24 dc 0 32 0 r . . 8 8 8 8 0 24 0 16 16 16 16 0 0 None
0x4f 24 dc 0 32 0 r y . 8 8 8 8 0 24 8 0 0 0 0 0 0 None
0x50 24 dc 0 32 0 r . . 8 8 8 8 0 24 8 0 0 0 0 0 0 None
0x51 24 dc 0 32 0 r y . 8 8 8 8 0 24 0 0 0 0 0 0 0 None
0x52 24 dc 0 32 0 r . . 8 8 8 8 0 24 0 0 0 0 0 0 0 None
0x53 24 dc 0 32 0 r y . 8 8 8 8 0 24 8 16 16 16 16 0 0 None
0x54 24 dc 0 32 0 r . . 8 8 8 8 0 24 8 16 16 16 16 0 0 None
0x55 24 dc 0 32 0 r y . 8 8 8 8 0 24 0 16 16 16 16 0 0 None
0x56 24 dc 0 32 0 r . . 8 8 8 8 0 24 0 16 16 16 16 0 0 None
0x57 24 dc 0 32 0 r y . 8 8 8 8 0 24 8 0 0 0 0 2 1 None
0x58 24 dc 0 32 0 r . . 8 8 8 8 0 24 8 0 0 0 0 2 1 None
0x59 24 dc 0 32 0 r y . 8 8 8 8 0 24 0 0 0 0 0 2 1 None
0x5a 24 dc 0 32 0 r . . 8 8 8 8 0 24 0 0 0 0 0 2 1 None
0x5b 24 dc 0 32 0 r y . 8 8 8 8 0 24 8 16 16 16 16 0 0 None
0x5c 24 dc 0 32 0 r . . 8 8 8 8 0 24 8 16 16 16 16 0 0 None
0x5d 24 dc 0 32 0 r y . 8 8 8 8 0 24 0 16 16 16 16 0 0 None
0x5e 24 dc 0 32 0 r . . 8 8 8 8 0 24 0 16 16 16 16 0 0 None
0x5f 24 dc 0 32 0 r y . 8 8 8 8 0 24 8 0 0 0 0 4 1 None
0x60 24 dc 0 32 0 r . . 8 8 8 8 0 24 8 0 0 0 0 4 1 None
0x61 24 dc 0 32 0 r y . 8 8 8 8 0 24 0 0 0 0 0 4 1 None
0x62 24 dc 0 32 0 r . . 8 8 8 8 0 24 0 0 0 0 0 4 1 None
0x63 24 dc 0 32 0 r y . 8 8 8 8 0 24 8 16 16 16 16 0 0 None
0x64 24 dc 0 32 0 r . . 8 8 8 8 0 24 8 16 16 16 16 0 0 None
0x65 24 dc 0 32 0 r y . 8 8 8 8 0 24 0 16 16 16 16 0 0 None
0x66 24 dc 0 32 0 r . . 8 8 8 8 0 24 0 16 16 16 16 0 0 None
0x6b 24 dc 0 32 0 r y . 8 8 8 8 0 24 8 16 16 16 16 0 0 None
0x6c 24 dc 0 32 0 r . . 8 8 8 8 0 24 8 16 16 16 16 0 0 None
0x6d 24 dc 0 32 0 r y . 8 8 8 8 0 24 0 16 16 16 16 0 0 None
0x6e 24 dc 0 32 0 r . . 8 8 8 8 0 24 0 16 16 16 16 0 0 None
0xa4 32 tc 0 32 0 r . . 8 8 8 8 0 24 0 0 0 0 0 4 1 Ncon

75 GLXFBConfigs:
visual x bf lv rg d st colorbuffer ax dp st accumbuffer ms cav
id dep cl sp sz l ci b ro r g b a bf th cl r g b a ns b eat
----------------------------------------------------------------------
0x23 0 tc 0 32 0 r y . 8 8 8 8 0 24 8 16 16 16 16 0 0 None
0x24 0 tc 0 32 0 r . . 8 8 8 8 0 24 8 16 16 16 16 0 0 None
0x25 0 tc 0 32 0 r y . 8 8 8 8 0 24 0 16 16 16 16 0 0 None
0x26 0 tc 0 32 0 r . . 8 8 8 8 0 24 0 16 16 16 16 0 0 None
0x27 0 tc 0 32 0 r y . 8 8 8 8 0 24 8 0 0 0 0 0 0 None
0x28 0 tc 0 32 0 r . . 8 8 8 8 0 24 8 0 0 0 0 0 0 None
0x29 0 tc 0 32 0 r y . 8 8 8 8 0 24 0 0 0 0 0 0 0 None
0x2a 0 tc 0 32 0 r . . 8 8 8 8 0 24 0 0 0 0 0 0 0 None
0x2b 0 tc 0 32 0 r y . 8 8 8 8 0 24 8 16 16 16 16 0 0 None
0x2c 0 tc 0 32 0 r . . 8 8 8 8 0 24 8 16 16 16 16 0 0 None
0x2d 0 tc 0 32 0 r y . 8 8 8 8 0 24 0 16 16 16 16 0 0 None
0x2e 0 tc 0 32 0 r . . 8 8 8 8 0 24 0 16 16 16 16 0 0 None
0x2f 0 tc 0 32 0 r y . 8 8 8 8 0 24 8 0 0 0 0 2 1 None
0x30 0 tc 0 32 0 r . . 8 8 8 8 0 24 8 0 0 0 0 2 1 None
0x31 0 tc 0 32 0 r y . 8 8 8 8 0 24 0 0 0 0 0 2 1 None
0x32 0 tc 0 32 0 r . . 8 8 8 8 0 24 0 0 0 0 0 2 1 None
0x33 0 tc 0 32 0 r y . 8 8 8 8 0 24 8 16 16 16 16 0 0 None
0x34 0 tc 0 32 0 r . . 8 8 8 8 0 24 8 16 16 16 16 0 0 None
0x35 0 tc 0 32 0 r y . 8 8 8 8 0 24 0 16 16 16 16 0 0 None
0x36 0 tc 0 32 0 r . . 8 8 8 8 0 24 0 16 16 16 16 0 0 None
0x37 0 tc 0 32 0 r y . 8 8 8 8 0 24 8 0 0 0 0 4 1 None
0x38 0 tc 0 32 0 r . . 8 8 8 8 0 24 8 0 0 0 0 4 1 None
0x39 0 tc 0 32 0 r y . 8 8 8 8 0 24 0 0 0 0 0 4 1 None
0x3a 0 tc 0 32 0 r . . 8 8 8 8 0 24 0 0 0 0 0 4 1 None
0x3b 0 tc 0 32 0 r y . 8 8 8 8 0 24 8 16 16 16 16 0 0 None
0x3c 0 tc 0 32 0 r . . 8 8 8 8 0 24 8 16 16 16 16 0 0 None
0x3d 0 tc 0 32 0 r y . 8 8 8 8 0 24 0 16 16 16 16 0 0 None
0x3e 0 tc 0 32 0 r . . 8 8 8 8 0 24 0 16 16 16 16 0 0 None
0x43 0 tc 0 32 0 r y . 8 8 8 8 0 24 8 16 16 16 16 0 0 None
0x44 0 tc 0 32 0 r . . 8 8 8 8 0 24 8 16 16 16 16 0 0 None
0x45 0 tc 0 32 0 r y . 8 8 8 8 0 24 0 16 16 16 16 0 0 None
0x46 0 tc 0 32 0 r . . 8 8 8 8 0 24 0 16 16 16 16 0 0 None
0x4b 0 dc 0 32 0 r y . 8 8 8 8 0 24 8 16 16 16 16 0 0 None
0x4c 0 dc 0 32 0 r . . 8 8 8 8 0 24 8 16 16 16 16 0 0 None
0x4d 0 dc 0 32 0 r y . 8 8 8 8 0 24 0 16 16 16 16 0 0 None
0x4e 0 dc 0 32 0 r . . 8 8 8 8 0 24 0 16 16 16 16 0 0 None
0x4f 0 dc 0 32 0 r y . 8 8 8 8 0 24 8 0 0 0 0 0 0 None
0x50 0 dc 0 32 0 r . . 8 8 8 8 0 24 8 0 0 0 0 0 0 None
0x51 0 dc 0 32 0 r y . 8 8 8 8 0 24 0 0 0 0 0 0 0 None
0x52 0 dc 0 32 0 r . . 8 8 8 8 0 24 0 0 0 0 0 0 0 None
0x53 0 dc 0 32 0 r y . 8 8 8 8 0 24 8 16 16 16 16 0 0 None
0x54 0 dc 0 32 0 r . . 8 8 8 8 0 24 8 16 16 16 16 0 0 None
0x55 0 dc 0 32 0 r y . 8 8 8 8 0 24 0 16 16 16 16 0 0 None
0x56 0 dc 0 32 0 r . . 8 8 8 8 0 24 0 16 16 16 16 0 0 None
0x57 0 dc 0 32 0 r y . 8 8 8 8 0 24 8 0 0 0 0 2 1 None
0x58 0 dc 0 32 0 r . . 8 8 8 8 0 24 8 0 0 0 0 2 1 None
0x59 0 dc 0 32 0 r y . 8 8 8 8 0 24 0 0 0 0 0 2 1 None
0x5a 0 dc 0 32 0 r . . 8 8 8 8 0 24 0 0 0 0 0 2 1 None
0x5b 0 dc 0 32 0 r y . 8 8 8 8 0 24 8 16 16 16 16 0 0 None
0x5c 0 dc 0 32 0 r . . 8 8 8 8 0 24 8 16 16 16 16 0 0 None
0x5d 0 dc 0 32 0 r y . 8 8 8 8 0 24 0 16 16 16 16 0 0 None
0x5e 0 dc 0 32 0 r . . 8 8 8 8 0 24 0 16 16 16 16 0 0 None
0x5f 0 dc 0 32 0 r y . 8 8 8 8 0 24 8 0 0 0 0 4 1 None
0x60 0 dc 0 32 0 r . . 8 8 8 8 0 24 8 0 0 0 0 4 1 None
0x61 0 dc 0 32 0 r y . 8 8 8 8 0 24 0 0 0 0 0 4 1 None
0x62 0 dc 0 32 0 r . . 8 8 8 8 0 24 0 0 0 0 0 4 1 None
0x63 0 dc 0 32 0 r y . 8 8 8 8 0 24 8 16 16 16 16 0 0 None
0x64 0 dc 0 32 0 r . . 8 8 8 8 0 24 8 16 16 16 16 0 0 None
0x65 0 dc 0 32 0 r y . 8 8 8 8 0 24 0 16 16 16 16 0 0 None
0x66 0 dc 0 32 0 r . . 8 8 8 8 0 24 0 16 16 16 16 0 0 None
0x6b 0 dc 0 32 0 r y . 8 8 8 8 0 24 8 16 16 16 16 0 0 None
0x6c 0 dc 0 32 0 r . . 8 8 8 8 0 24 8 16 16 16 16 0 0 None
0x6d 0 dc 0 32 0 r y . 8 8 8 8 0 24 0 16 16 16 16 0 0 None
0x6e 0 dc 0 32 0 r . . 8 8 8 8 0 24 0 16 16 16 16 0 0 None
0xa4 0 tc 0 32 0 r . . 8 8 8 8 0 24 0 0 0 0 0 4 1 Ncon
0xa4 0 tc 0 32 0 r y . 8 8 8 8 0 24 0 0 0 0 0 0 0 Ncon
0xa4 0 tc 0 32 0 r y . 8 8 8 8 0 24 8 0 0 0 0 0 0 Ncon
0xa4 0 tc 0 32 0 r . . 8 8 8 8 0 24 8 0 0 0 0 0 0 Ncon
0xa4 0 tc 0 32 0 r . . 8 8 8 8 0 0 0 0 0 0 0 0 0 Ncon
0xa4 0 tc 0 128 0 y . 32 32 32 32 0 24 0 0 0 0 0 0 0 None
0xa4 0 tc 0 128 0 . . 32 32 32 32 0 24 0 0 0 0 0 0 0 None
0xa4 0 tc 0 64 0 y . 16 16 16 16 0 24 0 0 0 0 0 0 0 None
0xa4 0 tc 0 64 0 . . 16 16 16 16 0 24 0 0 0 0 0 0 0 None
0xa4 0 tc 0 32 0 y . 11 11 10 0 0 24 0 0 0 0 0 0 0 None
0xa4 0 tc 0 32 0 . . 11 11 10 0 0 24 0 0 0 0 0 0 0 None

ZbuffeR
02-06-2011, 03:27 PM
glutInitDisplayMode (GLUT_SINGLE | GLUT_RGB);
Why a single buffer here ? It is fragile as hell
You should try to rewrite your program to work with GLUT_DOUBLE instead.

Dragonsoulj
02-06-2011, 03:32 PM
This was a program we were basing our code off of in class. It came out of our textbook. How would I go about changing it over? Just switching GLUT_SINGLE to GLUT_DOUBLE?

_arts_
02-07-2011, 05:49 AM
a bit things more:

you'll also need to clear the color buffer at the beginning of the rendering function and swap the buffers at the end:



glClearColor (GL_COLOR_BUFFER_BIT);
...
glutSwapBuffers();

Dragonsoulj
02-08-2011, 10:23 AM
I understand why I would need to swap the buffers. If this is supposed to be like a paint program where you can draw multiple different shapes would I still need to clear? Or just initially and when they select clear?

_arts_
02-09-2011, 04:29 AM
If you don't clear the buffer, the previous image you rendered on this buffer would be kept.

So, all depends on your needs. What I wrote last post was just the usual behavior, for normal programs.

Dragonsoulj
02-09-2011, 02:34 PM
Swapping the single with the double and switching glFlush() with glutSwapBuffers() works partially. The menu still doesn't properly render and I have to click the menu open to show what was just drawn. I am not sure what is up with the menu function not drawing properly.

I would also like to note that the program still works on NVidia computers properly.

_arts_
02-10-2011, 05:37 AM
To my opinion it is a problem with glut.
Try to use freeglut and let know how it works.

Dragonsoulj
02-10-2011, 11:14 AM
I've currently been using the freeglut in all trials. (2 separate 64bit NVidia computers which work fine and my 1 64bit ATI computer.)

ZbuffeR
02-11-2011, 01:30 AM
_arts_ : in fact on most linux distributions, glut is implemented with freeglut, for both license reasons and code quality.

_arts_
02-11-2011, 09:55 AM
_arts_ : in fact on most linux distributions, glut is implemented with freeglut, for both license reasons and code quality.

Mmmm. I have at least 2 glut implementations on my Debian, at least, as far as I can understand it :) But maybe they are the same ?

Dragonsoulj: I downloaded your sample. From what I can saw, I don't have the menu bug we can see on the picture, but maybe if we can see this on the picture, it's because you don't have any glut display function (it's commented). Try to come back from your teacher progam and make little changes until you have what expected.