Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

DarkKiller

How can I do a simple 2D-Interface with textures?

This topic is 5744 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I need a 2D-Texture on the screen to add some information like radar or weapon-ammo.... blood, or whatever to the screen. How can I do that?

Share this post


Link to post
Share on other sites
Advertisement
Keep in mind that this suggestion comes from another OpenGL beginner:

How are you with bitmaps? I haven''t checked NeHe''s tutorials yet, but OpenGL Game Programming does a great job of explaining the structure of bitmap files in Windows. You can basically set them bit by bit.

look up the following topics in MSDN:

BITMAPFILEHEADER
BITMAPINFOHEADER
glDrawPixels
glReadPixels

This plus either fopen, fread, or the CFile class should give you enough info to be able to read a .bmp file, modify some of the pixels, and spit it out to the screen.

Is there a better way to do what he wants than to just draw a programmatically-manipulated bitmap on the screen?

Share this post


Link to post
Share on other sites
Yes. Textured quads in orto mode.

Look up

glOrtho()

GL_QUADS

or check this forum for countless of other threads asking (and being answered) the same question.

2DNow - Specializing in yesterday''s technology today!

Share this post


Link to post
Share on other sites
jo.. i would say so. ortho mask would be ok i think. for blood and decals you should use a partical engine. think thats the usual way of doing such things

Share this post


Link to post
Share on other sites
all right thankx a lott!

I''m familar with bmp and can texture my objects with bmp and jpg.
Thats no problem.

the more important this to do is the translation of all the interface-stuff so that it fit to my screen in every case (moving, rotation and field of view!!)

I''m not familar with matrixes but I''m about to learn that.

Share this post


Link to post
Share on other sites
The field of view is still a problem for me.

I went through different drawText() functions from nehe and gametutorials.com but I still don't get it...

maybe anyone is able to explain it easy


I need a function that allows me to position my 2d-picture everywhere on the screen (existing) but I must still be able to change the field of view without seeing the 2d moving (not existing). It should not matter whether I use 45 degree or 75... (I hope you understand what I try to explain here )

[edited by - DarkKiller on October 3, 2002 5:53:35 AM]

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!