
How can i use OpenGL in Linux (RedHat 9.0)?
Hi!
How can i use OpenGl in RedHat 9.0.
I''ve heared that i must use MESA and GLUT. I''ve downloaded the packages and trieed to install them. Unfortunately it doesn''t work
Can anyone tell me, which packages i exactly need? (a link will not be bad)
Thanks
PS: Sorry, if my english is terrible, but i come from Austria and it is not my mother language.

Harry
You shouldn''t need to do anything to setup OpenGL in most cases. However, if OpenGL is running slowly, it''s probably running without hardware acceleration.
DRI is the framework that most hardware is accelerated with in Linux, it includes its own Mesa derivation for OpenGL acceleration. Ensure you card is properly configured to use DRI, if its meant to (try "glxinfo" in a terminal for more information about your card''s current state of OpenGL setup).
NVidia cards are the notable exception; NVidia won''t release details about their hardware to the DRI team, so you must use their closed (but high quality) drivers to get OpenGL hardware acceleration from an NVidia chipset.

DRI is the framework that most hardware is accelerated with in Linux, it includes its own Mesa derivation for OpenGL acceleration. Ensure you card is properly configured to use DRI, if its meant to (try "glxinfo" in a terminal for more information about your card''s current state of OpenGL setup).
NVidia cards are the notable exception; NVidia won''t release details about their hardware to the DRI team, so you must use their closed (but high quality) drivers to get OpenGL hardware acceleration from an NVidia chipset.

I installed the NVida driver, but it still doesn''t work 
Ok, the driver from NVidia works, but i can''t compile a program.
Here is the info from glxinfo:
name of display: :0.0
display: :0 screen: 0
direct rendering: Yes
server glx vendor string: NVIDIA Corporation
server glx version string: 1.3
server glx extensions:
GLX_EXT_visual_info, GLX_EXT_visual_rating, GLX_SGIX_fbconfig,
GLX_SGIX_pbuffer
client glx vendor string: NVIDIA Corporation
client glx version string: 1.3
client glx extensions:
GLX_ARB_get_proc_address, GLX_ARB_multisample, GLX_EXT_visual_info,
GLX_EXT_visual_rating, GLX_EXT_import_context, GLX_SGI_video_sync,
GLX_SGIX_swap_group, GLX_SGIX_swap_barrier, GLX_SGIX_fbconfig,
GLX_SGIX_pbuffer, GLX_NV_float_buffer
GLX extensions:
GLX_EXT_visual_info, GLX_EXT_visual_rating, GLX_SGIX_fbconfig,
GLX_SGIX_pbuffer, GLX_ARB_get_proc_address
OpenGL vendor string: NVIDIA Corporation
OpenGL renderer string: GeForce2 MX/AGP/3DNOW!
OpenGL version string: 1.4.0 NVIDIA 43.63
OpenGL extensions:
GL_ARB_imaging, GL_ARB_multitexture, GL_ARB_point_parameters,
GL_ARB_texture_compression, 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_transpose_matrix, GL_ARB_vertex_buffer_object,
GL_ARB_vertex_program, GL_ARB_window_pos, GL_S3_s3tc, GL_EXT_abgr,
GL_EXT_bgra, GL_EXT_blend_color, GL_EXT_blend_minmax,
GL_EXT_blend_subtract, GL_EXT_clip_volume_hint,
GL_EXT_compiled_vertex_array, GL_EXT_draw_range_elements,
GL_EXT_fog_coord, GL_EXT_multi_draw_arrays, GL_EXT_packed_pixels,
GL_EXT_paletted_texture, GL_EXT_point_parameters, GL_EXT_rescale_normal,
GL_EXT_secondary_color, GL_EXT_separate_specular_color,
GL_EXT_shared_texture_palette, GL_EXT_stencil_wrap,
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_lod,
GL_EXT_texture_lod_bias, GL_EXT_texture_object, GL_EXT_vertex_array,
GL_IBM_texture_mirrored_repeat, GL_KTX_buffer_region, GL_NV_blend_square,
GL_NV_fence, GL_NV_fog_distance, GL_NV_light_max_exponent,
GL_NV_packed_depth_stencil, GL_NV_pixel_data_range, GL_NV_point_sprite,
GL_NV_register_combiners, GL_NV_texgen_reflection,
GL_NV_texture_env_combine4, GL_NV_texture_rectangle,
GL_NV_vertex_array_range, GL_NV_vertex_array_range2, GL_NV_vertex_program,
GL_NV_vertex_program1_1, GL_NVX_ycrcb, GL_SGIS_generate_mipmap,
GL_SGIS_multitexture, GL_SGIS_texture_lod
glu version: 1.3
glu extensions:
GLU_EXT_nurbs_tessellator, GLU_EXT_object_space_tess
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
----------------------------------------------------------------------
0x21 24 tc 0 32 0 r y . 8 8 8 0 0 24 8 16 16 16 16 0 0 None
0x22 24 dc 0 32 0 r y . 8 8 8 0 0 24 8 16 16 16 16 0 0 None
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 0 0 24 8 16 16 16 16 0 0 None
0x25 24 tc 0 32 0 r . . 8 8 8 8 0 24 8 16 16 16 16 0 0 None
0x26 24 tc 0 32 0 r y . 8 8 8 0 0 16 0 16 16 16 16 0 0 None
0x27 24 tc 0 32 0 r y . 8 8 8 8 0 16 0 16 16 16 16 0 0 None
0x28 24 tc 0 32 0 r . . 8 8 8 0 0 16 0 16 16 16 16 0 0 None
0x29 24 tc 0 32 0 r . . 8 8 8 8 0 16 0 16 16 16 16 0 0 None
0x2a 24 tc 0 32 0 r y . 8 8 8 0 0 0 0 16 16 16 16 0 0 None
0x2b 24 tc 0 32 0 r y . 8 8 8 8 0 0 0 16 16 16 16 0 0 None
0x2c 24 tc 0 32 0 r . . 8 8 8 0 0 0 0 16 16 16 16 0 0 None
0x2d 24 tc 0 32 0 r . . 8 8 8 8 0 0 0 16 16 16 16 0 0 None
0x2e 24 dc 0 32 0 r y . 8 8 8 8 0 24 8 16 16 16 16 0 0 None
0x2f 24 dc 0 32 0 r . . 8 8 8 0 0 24 8 16 16 16 16 0 0 None
0x30 24 dc 0 32 0 r . . 8 8 8 8 0 24 8 16 16 16 16 0 0 None
0x31 24 dc 0 32 0 r y . 8 8 8 0 0 16 0 16 16 16 16 0 0 None
0x32 24 dc 0 32 0 r y . 8 8 8 8 0 16 0 16 16 16 16 0 0 None
0x33 24 dc 0 32 0 r . . 8 8 8 0 0 16 0 16 16 16 16 0 0 None
0x34 24 dc 0 32 0 r . . 8 8 8 8 0 16 0 16 16 16 16 0 0 None
0x35 24 dc 0 32 0 r y . 8 8 8 0 0 0 0 16 16 16 16 0 0 None
0x36 24 dc 0 32 0 r y . 8 8 8 8 0 0 0 16 16 16 16 0 0 None
0x37 24 dc 0 32 0 r . . 8 8 8 0 0 0 0 16 16 16 16 0 0 None
0x38 24 dc 0 32 0 r . . 8 8 8 8 0 0 0 16 16 16 16 0 0 None
My graficcard is an Nvida Geforce 2 MX 400.

Ok, the driver from NVidia works, but i can''t compile a program.
Here is the info from glxinfo:
name of display: :0.0
display: :0 screen: 0
direct rendering: Yes
server glx vendor string: NVIDIA Corporation
server glx version string: 1.3
server glx extensions:
GLX_EXT_visual_info, GLX_EXT_visual_rating, GLX_SGIX_fbconfig,
GLX_SGIX_pbuffer
client glx vendor string: NVIDIA Corporation
client glx version string: 1.3
client glx extensions:
GLX_ARB_get_proc_address, GLX_ARB_multisample, GLX_EXT_visual_info,
GLX_EXT_visual_rating, GLX_EXT_import_context, GLX_SGI_video_sync,
GLX_SGIX_swap_group, GLX_SGIX_swap_barrier, GLX_SGIX_fbconfig,
GLX_SGIX_pbuffer, GLX_NV_float_buffer
GLX extensions:
GLX_EXT_visual_info, GLX_EXT_visual_rating, GLX_SGIX_fbconfig,
GLX_SGIX_pbuffer, GLX_ARB_get_proc_address
OpenGL vendor string: NVIDIA Corporation
OpenGL renderer string: GeForce2 MX/AGP/3DNOW!
OpenGL version string: 1.4.0 NVIDIA 43.63
OpenGL extensions:
GL_ARB_imaging, GL_ARB_multitexture, GL_ARB_point_parameters,
GL_ARB_texture_compression, 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_transpose_matrix, GL_ARB_vertex_buffer_object,
GL_ARB_vertex_program, GL_ARB_window_pos, GL_S3_s3tc, GL_EXT_abgr,
GL_EXT_bgra, GL_EXT_blend_color, GL_EXT_blend_minmax,
GL_EXT_blend_subtract, GL_EXT_clip_volume_hint,
GL_EXT_compiled_vertex_array, GL_EXT_draw_range_elements,
GL_EXT_fog_coord, GL_EXT_multi_draw_arrays, GL_EXT_packed_pixels,
GL_EXT_paletted_texture, GL_EXT_point_parameters, GL_EXT_rescale_normal,
GL_EXT_secondary_color, GL_EXT_separate_specular_color,
GL_EXT_shared_texture_palette, GL_EXT_stencil_wrap,
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_lod,
GL_EXT_texture_lod_bias, GL_EXT_texture_object, GL_EXT_vertex_array,
GL_IBM_texture_mirrored_repeat, GL_KTX_buffer_region, GL_NV_blend_square,
GL_NV_fence, GL_NV_fog_distance, GL_NV_light_max_exponent,
GL_NV_packed_depth_stencil, GL_NV_pixel_data_range, GL_NV_point_sprite,
GL_NV_register_combiners, GL_NV_texgen_reflection,
GL_NV_texture_env_combine4, GL_NV_texture_rectangle,
GL_NV_vertex_array_range, GL_NV_vertex_array_range2, GL_NV_vertex_program,
GL_NV_vertex_program1_1, GL_NVX_ycrcb, GL_SGIS_generate_mipmap,
GL_SGIS_multitexture, GL_SGIS_texture_lod
glu version: 1.3
glu extensions:
GLU_EXT_nurbs_tessellator, GLU_EXT_object_space_tess
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
----------------------------------------------------------------------
0x21 24 tc 0 32 0 r y . 8 8 8 0 0 24 8 16 16 16 16 0 0 None
0x22 24 dc 0 32 0 r y . 8 8 8 0 0 24 8 16 16 16 16 0 0 None
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 0 0 24 8 16 16 16 16 0 0 None
0x25 24 tc 0 32 0 r . . 8 8 8 8 0 24 8 16 16 16 16 0 0 None
0x26 24 tc 0 32 0 r y . 8 8 8 0 0 16 0 16 16 16 16 0 0 None
0x27 24 tc 0 32 0 r y . 8 8 8 8 0 16 0 16 16 16 16 0 0 None
0x28 24 tc 0 32 0 r . . 8 8 8 0 0 16 0 16 16 16 16 0 0 None
0x29 24 tc 0 32 0 r . . 8 8 8 8 0 16 0 16 16 16 16 0 0 None
0x2a 24 tc 0 32 0 r y . 8 8 8 0 0 0 0 16 16 16 16 0 0 None
0x2b 24 tc 0 32 0 r y . 8 8 8 8 0 0 0 16 16 16 16 0 0 None
0x2c 24 tc 0 32 0 r . . 8 8 8 0 0 0 0 16 16 16 16 0 0 None
0x2d 24 tc 0 32 0 r . . 8 8 8 8 0 0 0 16 16 16 16 0 0 None
0x2e 24 dc 0 32 0 r y . 8 8 8 8 0 24 8 16 16 16 16 0 0 None
0x2f 24 dc 0 32 0 r . . 8 8 8 0 0 24 8 16 16 16 16 0 0 None
0x30 24 dc 0 32 0 r . . 8 8 8 8 0 24 8 16 16 16 16 0 0 None
0x31 24 dc 0 32 0 r y . 8 8 8 0 0 16 0 16 16 16 16 0 0 None
0x32 24 dc 0 32 0 r y . 8 8 8 8 0 16 0 16 16 16 16 0 0 None
0x33 24 dc 0 32 0 r . . 8 8 8 0 0 16 0 16 16 16 16 0 0 None
0x34 24 dc 0 32 0 r . . 8 8 8 8 0 16 0 16 16 16 16 0 0 None
0x35 24 dc 0 32 0 r y . 8 8 8 0 0 0 0 16 16 16 16 0 0 None
0x36 24 dc 0 32 0 r y . 8 8 8 8 0 0 0 16 16 16 16 0 0 None
0x37 24 dc 0 32 0 r . . 8 8 8 0 0 0 0 16 16 16 16 0 0 None
0x38 24 dc 0 32 0 r . . 8 8 8 8 0 0 0 16 16 16 16 0 0 None
My graficcard is an Nvida Geforce 2 MX 400.
Harry
Could you please give the exact command you are using and the exact error message(s)?
To compile OpenGL/GLUT programs, you will need the following packages (I don''t use a RedHat distrib, so I may be wrong) :
- glut and glut-devel
- XFree86-devel (this one should contain headers for OpenGL)
You may also take a look at the SDL library (http://www.libsdl.org) instead of glut. It takes care of video, input, sound (but maybe you''d prefer openal for sound) and it''s cross-platform.
- glut and glut-devel
- XFree86-devel (this one should contain headers for OpenGL)
You may also take a look at the SDL library (http://www.libsdl.org) instead of glut. It takes care of video, input, sound (but maybe you''d prefer openal for sound) and it''s cross-platform.
SaM3d!, a cross-platform API for 3d based on SDL and OpenGL.The trouble is that things never get better, they just stay the same, only more so. -- (Terry Pratchett, Eric)
Are you sure you''ve downloaded the glut-devel? also... for Nvidia driver, I think you have to copy gl.h from somewhere in the driver to replace that of Mesa. Please refer to the readme for more exact location.
quote:
Original post by varokasp
for Nvidia driver, I think you have to copy gl.h from somewhere in the driver to replace that of Mesa.
That''s not necessary. Just use the headers provided in the XFree86-devel package.
SaM3d!, a cross-platform API for 3d based on SDL and OpenGL.The trouble is that things never get better, they just stay the same, only more so. -- (Terry Pratchett, Eric)
I was going to compile the sample from this site:
http://www.eecs.tulane.edu/www/Terry/OpenGL/Simple_Example.html#A%20Simple%20Example
I''ve downloaded the sample and used the exact command from the site to compile the source. I received this error message:
[user@localhost user]$ gcc -o Hello_World Hello_World.c -lX11 -lMesaGL -lMesaGLU -lMesatk -lm
Hello_World.c:16:18: gltk.h: file or directory not found
Hello_World.c: In function `expose'':
Hello_World.c:21: `GL_COLOR_BUFFER_BIT'' undeclared (first use in this function)
Hello_World.c:21: (Each undeclared identifier is reported only once
Hello_World.c:21: for each function it appears in.)
Hello_World.c: In function `reshape'':
Hello_World.c:27: `GLint'' undeclared (first use in this function)
Hello_World.c:27: parse error before "width"
Hello_World.c:30: `GL_COLOR_BUFFER_BIT'' undeclared (first use in this function)
Hello_World.c: In function `draw'':
Hello_World.c:39: `GL_POLYGON'' undeclared (first use in this function)
Hello_World.c: In function `main'':
Hello_World.c:54: `GL_FALSE'' undeclared (first use in this function)
Hello_World.c:51: warning: return type of `main'' is not `int''
[user@localhost user]$
http://www.eecs.tulane.edu/www/Terry/OpenGL/Simple_Example.html#A%20Simple%20Example
I''ve downloaded the sample and used the exact command from the site to compile the source. I received this error message:
[user@localhost user]$ gcc -o Hello_World Hello_World.c -lX11 -lMesaGL -lMesaGLU -lMesatk -lm
Hello_World.c:16:18: gltk.h: file or directory not found
Hello_World.c: In function `expose'':
Hello_World.c:21: `GL_COLOR_BUFFER_BIT'' undeclared (first use in this function)
Hello_World.c:21: (Each undeclared identifier is reported only once
Hello_World.c:21: for each function it appears in.)
Hello_World.c: In function `reshape'':
Hello_World.c:27: `GLint'' undeclared (first use in this function)
Hello_World.c:27: parse error before "width"
Hello_World.c:30: `GL_COLOR_BUFFER_BIT'' undeclared (first use in this function)
Hello_World.c: In function `draw'':
Hello_World.c:39: `GL_POLYGON'' undeclared (first use in this function)
Hello_World.c: In function `main'':
Hello_World.c:54: `GL_FALSE'' undeclared (first use in this function)
Hello_World.c:51: warning: return type of `main'' is not `int''
[user@localhost user]$
Harry
June 09, 2003 07:17 AM
congradulations on venturing into linux. But I would recomend learning to program in C/C++ before trying to do any graphics/game programming.
Wow, I am not sure where to start on that last set of errors you got.
First of all, drop Mesa. Step back from the Mesa dude.
XFree86 now includes Mesa with the X distribution.
Secondly, you do need the x11-devel package.
Now to make some changes to that tutorial:
Change:
#include <gltk.h> to #include <GL/gl.h>
add #include <GL/glu.h> directly afterwards.
And to compile:
gcc -o Hello_World Hello_World.c -lX11 -lGL -lGLU -lm
Let me know what errors appear there. If you still have trouble, let me know, you can probably catch me on MSN Messenger.
First of all, drop Mesa. Step back from the Mesa dude.
XFree86 now includes Mesa with the X distribution.
Secondly, you do need the x11-devel package.
Now to make some changes to that tutorial:
Change:
#include <gltk.h> to #include <GL/gl.h>
add #include <GL/glu.h> directly afterwards.
And to compile:
gcc -o Hello_World Hello_World.c -lX11 -lGL -lGLU -lm
Let me know what errors appear there. If you still have trouble, let me know, you can probably catch me on MSN Messenger.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement
Recommended Tutorials
Advertisement