Newbie: OpenGL concepts

  • Follow


Hi, I need to re-write an extensive chunk of DiB graphics code in openGL and
would appreciate some help in understanding how best to approach the
problem. To make things clearer, the existing code generates various vehicle
instruments on-screen.

The dib code currently:
1. Loads bitmaps into memory.
2. may extract _part_ of a bitmap
3. rotates the bitmaps.
4. blits them to the screen.
5. Bitmaps may be overlaid (for example: scale, then needle and then bezel)

What would be the equivalent/recommended way of achieving this in OpenGL?

Thanks,

Roy.


0
Reply Roy 2/5/2004 3:54:11 PM

"Roy" <roy@mechnet.liv.ac.uk> schrieb im Newsbeitrag
news:bvtov3$agv$1@news.liv.ac.uk...
> Hi, I need to re-write an extensive chunk of DiB graphics code in openGL
and
> would appreciate some help in understanding how best to approach the
> problem. To make things clearer, the existing code generates various
vehicle
> instruments on-screen.
>
> The dib code currently:
> 1. Loads bitmaps into memory.
> 2. may extract _part_ of a bitmap
> 3. rotates the bitmaps.
> 4. blits them to the screen.
> 5. Bitmaps may be overlaid (for example: scale, then needle and then
bezel)
>
> What would be the equivalent/recommended way of achieving this in OpenGL?

IMHO nothing of this has to do with OpenGL. It's an render-API not an
imagelib.


0
Reply Sebastian 2/5/2004 4:50:07 PM


Roy wrote:
> Hi, I need to re-write an extensive chunk of DiB graphics code in openGL and
> would appreciate some help in understanding how best to approach the
> problem. To make things clearer, the existing code generates various vehicle
> instruments on-screen.
> 
> The dib code currently:
> 1. Loads bitmaps into memory.

Make textures from them.

> 2. may extract _part_ of a bitmap

Figure out texture coordinates for the bit you're
interested.

> 3. rotates the bitmaps.

glRotate();

> 4. blits them to the screen.

Draw a quad.

> 5. Bitmaps may be overlaid (for example: scale, then needle and then bezel)
> 

Textures can have transparency in the "alpha" channel.



-- 
<\___/>          For email, remove my socks.
/ O O \
\_____/  FTB.    Why isn't there mouse-flavored cat food?


0
Reply fungus 2/5/2004 5:13:39 PM

Roy wrote:
> 1. Loads bitmaps into memory.
> 2. may extract _part_ of a bitmap

Put your bitmpaps and parts of bitmaps on GL textures.

> 3. rotates the bitmaps.
> 4. blits them to the screen.

Draw texture mapped squares/rectangles/thin triangles/etc.
You can easily rotate/scale them.

> 5. Bitmaps may be overlaid (for example: scale, then needle and then bezel)

Enable blending, then define alpha components of the textures for the 
transparent parts.
Then, disable glDepthTest and draw the parts from the back to the front.

> What would be the equivalent/recommended way of achieving this in OpenGL?

Well, instead of texture mapped quads you can use glDrawPixels and the 
like, as it is more pixel oriented. But they will be both slow and 
inconvenient.

Hope it helps.

0
Reply zBuffer 2/5/2004 5:22:56 PM

"Sebastian "Psy" Messerschmidt"
<sebastian.messerschmidt@DELETETHISstud.tu-ilmenau.de> wrote in message
news:bvts6a$9a2$1@piggy.rz.tu-ilmenau.de...
>
> IMHO nothing of this has to do with OpenGL. It's an render-API not an
> imagelib.
>

But there are instances where I do need to use openGL primitives too. That I
can handle. How does one manage bitmaps though?

Roy.


0
Reply Roy 2/5/2004 5:48:39 PM

4 Replies
228 Views

(page loaded in 0.06 seconds)

Similiar Articles:






7/26/2012 3:53:03 PM


Reply: