Blog
OpenGL shenanigans
Date: 6/7/2005
So I'm trying to build a system that uses opengl to draw dynamic 2d images in windows. I have tried using big bitmaps in memory and then glTexImage2D to create the texture from the memory bitmap. But the texture is static then... and to change the texture you have to call glTexImage2D again. Which in my case takes forever (120ms) to read the bitmap in and update the texture.

glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, x, y, 0, GL_BGRA_EXT, GL_UNSIGNED_BYTE, bits);


Really what I want to do is draw on the texture using opengl. Or some other vector graphics api... although hardware acceleration is important so I'm assuming that I can't draw on the bitmap with any other type of hardware accelerated API. I really need to get my fill rate limitation off the CPU and into the GPU. Currently I've been using cairo to paint with and it's fill rate is woeful. I don't know whether that is cairo or just the CPU yet.

Maybe I will have to forget textures and just convert all the drawing commands to the opengl calls and clip the output against to the window's area. But that would mean changing the architecture to keep a display list of primitives around to "execute" everytime the screen needs updating. That doesn't sound like fun let alone an effcient way of doing things.
Comments:
fret
06/07/2005 9:25pm
This looks like what I need.... all hail pbuffers.
fret
07/07/2005 1:43am
Wait a minute... my nvidia quadro fx 1000 doesn't support pbuffers... it supports:
GL_ARB_depth_texture
GL_ARB_fragment_program
GL_ARB_fragment_program_shadow
GL_ARB_fragment_shader
GL_ARB_half_float_pixel
GL_ARB_imaging
GL_ARB_multisample
GL_ARB_multitexture
GL_ARB_occlusion_query
GL_ARB_point_parameters
GL_ARB_point_sprite
GL_ARB_shadow
GL_ARB_shader_objects
GL_ARB_shading_language_100
GL_ARB_texture_border_clamp
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_texture_rectangle
GL_ARB_transpose_matrix
GL_ARB_vertex_buffer_object
GL_ARB_vertex_program
GL_ARB_vertex_shader
GL_ARB_window_pos
GL_S3_s3tc
GL_EXT_texture_env_add
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_compiled_vertex_array
GL_EXT_Cg_shader
GL_EXT_draw_range_elements
GL_EXT_fog_coord
GL_EXT_framebuffer_object
GL_EXT_multi_draw_arrays
GL_EXT_packed_pixels
GL_EXT_paletted_texture
GL_EXT_pixel_buffer_object
GL_EXT_point_parameters
fret
07/07/2005 1:45am
Is there some registry of what cards/drivers support the various extensions? How is one supposed to find out which extensions are going to be supported on a large swath of the installed user base?
fret
08/07/2005 12:43am
Ok, pbuffers IS supported on my card, I just had to read the "extra" extensions listed by wglGetExtensionsStringARB as well.
fret
11/07/2005 8:46am
My g400 at home doesn't have pbuffer support. :(
 
Reply
From:
Email (optional): (Will be HTML encoded to evade harvesting)
Message:
 
Remember username and/or email in a cookie.
Notify me of new posts in this thread via email.
BBcode:
[q]text[/q]
[url=link]description[/url]
[img]url_to_image[/img]
[pre]some_code[/pre]
[b]bold_text[/b]