Ubuntu seems to be using freeglut now, and while it renders ok to the local display it fails to draw via GLX on a remote display. Maybe it doesn't get a valid context because glGetString(gl_version) returns null. However glutGet(GLUT_DISPLAY_MODE_POSSIBLE) returns true, and glxgears and glxinfo both work ok, so it appears to be a freeglut problem. Here's a small test program and output.
#include <stdio.h>
#include <GL/glut.h>
int main(int argc, char *argv[])
{
int win;
int ok;
char *str;
glutInit(&argc, argv); /* initialize GLUT system */
glutInitDisplayMode(GLUT_RGB);
ok = glutGet(GLUT_DISPLAY_MODE_POSSIBLE);
printf("GLUT_DISPLAYMODE_POSSIBLE = %d\n", ok);
glutInitWindowSize(400,500);
win = glutCreateWindow("test"); /* create window */
str = (char *) glGetString(GL_VERSION);
printf("GL_VERSION = %s\n", str);
return 0;
}
/* When run this prints this:
$ ./test
GLUT_DISPLAYMODE_POSSIBLE = 1
freeglut (./test): Unable to create direct context rendering for window 'test'
This may hurt performance.
GL_VERSION = (null)
$ ./test -indirect
GLUT_DISPLAYMODE_POSSIBLE = 1
GL_VERSION = (null)
And the window is useless when I try to draw in it.
However glxgears runs and glxinfo seems ok
$ glxinfo
name of display: localhost:10.0
display: localhost:10 screen: 0
direct rendering: No (If you want to find out why, try setting LIBGL_DEBUG=verbose)
server glx vendor string: SGI
server glx version string: 1.2
server glx extensions:
GLX_ARB_multisample, GLX_EXT_visual_info, GLX_EXT_visual_rating,
GLX_EXT_import_context, GLX_OML_swap_method, GLX_SGI_make_current_read,
GLX_SGIS_multisample, GLX_SGIX_hyperpipe, GLX_SGIX_swap_barrier,
GLX_SGIX_fbconfig
client glx vendor string: SGI
client glx version string: 1.4
client glx extensions:
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_copy_sub_buffer, GLX_MESA_swap_control,
GLX_MESA_swap_frame_usage, GLX_OML_swap_method, GLX_OML_sync_control,
GLX_SGI_make_current_read, GLX_SGI_swap_control, GLX_SGI_video_sync,
GLX_SGIS_multisample, GLX_SGIX_fbconfig, GLX_SGIX_pbuffer,
GLX_SGIX_visual_select_group, GLX_EXT_texture_from_pixmap
GLX version: 1.2
GLX extensions:
GLX_ARB_get_proc_address, GLX_ARB_multisample, GLX_EXT_import_context,
GLX_EXT_visual_info, GLX_EXT_visual_rating, GLX_OML_swap_method,
GLX_SGI_make_current_read, GLX_SGIS_multisample, GLX_SGIX_fbconfig
OpenGL vendor string: NVIDIA Corporation
OpenGL renderer string: Quadro NVS 140M/PCI/SSE2
OpenGL version string: 1.2 (2.1.1)
OpenGL extensions:
GL_ARB_depth_texture, GL_ARB_imaging, GL_ARB_multitexture,
GL_ARB_point_parameters, GL_ARB_point_sprite, GL_ARB_shadow,
GL_ARB_texture_border_clamp, GL_ARB_texture_cube_map,
GL_ARB_texture_env_add, GL_ARB_texture_env_combine,
GL_ARB_texture_env_dot3, GL_ARB_texture_mirrored_repeat,
GL_ARB_texture_rectangle, GL_ARB_transpose_matrix, GL_ARB_window_pos,
GL_EXT_abgr, GL_EXT_bgra, GL_EXT_blend_color, GL_EXT_blend_func_separate,
GL_EXT_blend_minmax, GL_EXT_blend_subtract, GL_EXT_draw_range_elements,
GL_EXT_fog_coord, GL_EXT_multi_draw_arrays, GL_EXT_packed_pixels,
GL_EXT_point_parameters, GL_EXT_rescale_normal, GL_EXT_secondary_color,
GL_EXT_separate_specular_color, GL_EXT_shadow_funcs,
GL_EXT_stencil_two_side, GL_EXT_stencil_wrap, GL_EXT_texture3D,
GL_EXT_texture_edge_clamp, GL_EXT_texture_env_add,
GL_EXT_texture_env_combine, GL_EXT_texture_env_dot3, GL_EXT_texture_lod,
GL_EXT_texture_lod_bias, GL_EXT_texture_object, GL_EXT_texture_rectangle,
GL_EXT_vertex_array, GL_ATI_texture_mirror_once,
GL_IBM_texture_mirrored_repeat, GL_INGR_blend_func_separate,
GL_NV_blend_square, GL_NV_point_sprite, GL_NV_texgen_reflection,
GL_NV_texture_rectangle, GL_SGIS_generate_mipmap,
GL_SGIS_texture_border_clamp, GL_SGIS_texture_edge_clamp,
GL_SGIS_texture_lod, GL_SGIX_depth_texture, GL_SGIX_shadow,
GL_SUN_multi_draw_arrays
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
----------------------------------------------------------------------
0x22 24 tc 1 24 0 r . . 8 8 8 0 0 0 0 0 0 0 0 0 0 None
0x23 24 tc 1 24 0 r . . 8 8 8 0 0 0 0 16 16 16 16 0 0 None
0x24 24 tc 1 24 0 r . . 8 8 8 0 0 0 8 0 0 0 0 0 0 None
0x25 24 tc 1 24 0 r . . 8 8 8 0 0 0 8 16 16 16 16 0 0 None
0x26 24 tc 1 24 0 r y . 8 8 8 0 0 0 0 0 0 0 0 0 0 None
0x27 24 tc 1 24 0 r y . 8 8 8 0 0 0 0 16 16 16 16 0 0 None
0x28 24 tc 1 24 0 r y . 8 8 8 0 0 0 8 0 0 0 0 0 0 None
0x29 24 tc 1 24 0 r y . 8 8 8 0 0 0 8 16 16 16 16 0 0 None
0x2a 24 tc 1 24 0 r . . 8 8 8 0 2 0 0 0 0 0 0 0 0 None
0x2b 24 tc 1 24 0 r . . 8 8 8 0 2 0 0 16 16 16 16 0 0 None
0x2c 24 tc 1 24 0 r . . 8 8 8 0 2 0 8 0 0 0 0 0 0 None
0x2d 24 tc 1 24 0 r . . 8 8 8 0 2 0 8 16 16 16 16 0 0 None
0x2e 24 tc 1 24 0 r y . 8 8 8 0 2 0 0 0 0 0 0 0 0 None
0x2f 24 tc 1 24 0 r y . 8 8 8 0 2 0 0 16 16 16 16 0 0 None
0x30 24 tc 1 24 0 r y . 8 8 8 0 2 0 8 0 0 0 0 0 0 None
0x31 24 tc 1 24 0 r y . 8 8 8 0 2 0 8 16 16 16 16 0 0 None
0x32 24 tc 1 24 0 r . . 8 8 8 0 0 24 0 0 0 0 0 0 0 None
0x33 24 tc 1 24 0 r . . 8 8 8 0 0 24 0 16 16 16 16 0 0 None
0x34 24 tc 1 24 0 r . . 8 8 8 0 0 24 8 0 0 0 0 0 0 None
0x35 24 tc 1 24 0 r . . 8 8 8 0 0 24 8 16 16 16 16 0 0 None
0x36 24 tc 1 24 0 r y . 8 8 8 0 0 24 0 0 0 0 0 0 0 None
0x37 24 tc 1 24 0 r y . 8 8 8 0 0 24 0 16 16 16 16 0 0 None
0x38 24 tc 1 24 0 r y . 8 8 8 0 0 24 8 0 0 0 0 0 0 None
0x39 24 tc 1 24 0 r y . 8 8 8 0 0 24 8 16 16 16 16 0 0 None
0x3a 24 tc 1 24 0 r . . 8 8 8 0 2 24 0 0 0 0 0 0 0 None
0x3b 24 tc 1 24 0 r . . 8 8 8 0 2 24 0 16 16 16 16 0 0 None
0x3c 24 tc 1 24 0 r . . 8 8 8 0 2 24 8 0 0 0 0 0 0 None
0x3d 24 tc 1 24 0 r . . 8 8 8 0 2 24 8 16 16 16 16 0 0 None
0x3e 24 tc 1 24 0 r y . 8 8 8 0 2 24 0 0 0 0 0 0 0 None
0x3f 24 tc 1 24 0 r y . 8 8 8 0 2 24 0 16 16 16 16 0 0 None
0x40 24 tc 1 24 0 r y . 8 8 8 0 2 24 8 0 0 0 0 0 0 None
0x41 24 tc 1 24 0 r y . 8 8 8 0 2 24 8 16 16 16 16 0 0 None
$
*/
After some reading up on GLX I believe freeglut probably ought to check for GLX version 1.3 or above before using the GLX 1.3 subroutines (with GLXFBConfig structures). I suspect the original glut worked with GLX1.2. Freeglut does not.