Jump to content
  • Advertisement

Archived

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

Squizz

Raster Layer

This topic is 6248 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

Please help me how do I use the raster layer to display bitmaps????????? Thnkz Squizz-Repaint the World

Share this post


Link to post
Share on other sites
Advertisement
Come on people I''m making an OpenGL tetris game this is my gui. I want to use a bitmap for my gui. PLease explain drawing a bitmap using the raster layer or some other 2d method. I don''t want a textured quad. I want pixel to pixel.

PLEASE HELP!!!!!!

Squizz-Repaint the World

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
Textured quads would probably be the fastest way. However, if you don''t want to do that, try using glDrawPixels.

Share this post


Link to post
Share on other sites
Surely there is an easier way than manauly changing every picture. I SCREAM out to everyone who knows a lot about OpenGL PLEASE how does one load a bitmap onto the raster layer, or some other method of loading a bitmap so its not affected so its 2d. It makes common sense that such a thing is possible... will someone please tell me HOW.

Squizz-Repaint the World

Share this post


Link to post
Share on other sites

Dude just set OpenGL into glOrtho mode and as AP said draw the image on a quad this is a very easy and fast way of doing what you want.

3DG

Share this post


Link to post
Share on other sites
I feel your pain. I''m used to IRIS GL which has additionaly functionality in regards to pixel blitting and stuff. They sorta stripped those routines out of openGL presumably because they wanted 3D only and left the raster stuff to the OS.

I''ve been using SDL lately as my openGL wrapper. I believe it grew up as a raster engine and has openGL plugged into it. I think you can still use the raster aspects mixed with the openGL aspects, but I could be wrong.

Share this post


Link to post
Share on other sites
quote:
Original post by miles vignol
I''ve been using SDL lately as my openGL wrapper. I believe it grew up as a raster engine and has openGL plugged into it. I think you can still use the raster aspects mixed with the openGL aspects, but I could be wrong.

That works (for most people, at least), but it can cause a major slow down.

Squizz, this is how you''d use vertex coordinates as pixel coordinates:
  
glViewport(0,0,ScreenWidth,ScreenHeight);

glMatrixMode(GL_PROJECTION);
glLoadIdentity();

glOrtho(0.0f,ScreenWidth,ScreenHeight,0.0f,-1.0f,1.0f);

glMatrixMode(GL_MODELVIEW);
glLoadIdentity();



[Resist Windows XP''s Invasive Production Activation Technology!]

Share this post


Link to post
Share on other sites
What you guys are telling me there is NO WAY like a draw command or something that I can feed a bitmap into????
Cause I think pixels (I''m going to try them)
I think it might be a bit slow, considering roughly a third of the screen will be "2d"

Thankz

Squizz-Repaint the World

Share this post


Link to post
Share on other sites
glDrawPixels is poorly implemented in most consumer drivers, that''s why we don''t advise using it. Rendering quads isn''t slow (especially not with an orthographic project matrix, since the depth transformation is skipped by any decent drivers). You only have to call all of that once, then you just use glVertex2_ to render coordinates.

[Resist Windows XP''s Invasive Production Activation Technology!]

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.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!