GUI question

Started by
2 comments, last by Slyxsith 21 years, 8 months ago
Pardon my ignorance but with a C++ prog can I just use standard image files and call them up for use in a GUI? eaxmple: Can I create buttons and backgrounds etc and then write a menu app that actually just calls my JPGs etc and writes them in locations and windows? Can you stretch-to-fill with images from inside teh C++ app or do the backgrounds have to be the size of the "window"? Again please excuse my ignorance Im not a coder. (what was your first clue? ) Thank you in advance for your suggestions. Mark M

Mark MacPherson
Flybynight Studios: Owner
Current Skillsets: Project Manager - Team Lead - Scripter - 2D Artwork - Basic 3D Modeller - Web Development - Marketing - Administration

Advertisement
Yes.
You will need a function to be able load the images. You can download libraries that will do this, such as DevIL or whatever.

However, these libraries will need to be compatible with the code used to draw the images. (There is no inbuilt graphics functionality in C++.) If you just use DirectDraw or something, code will have to be written to put the image into a DirectDraw Surface first.

And whether you can stretch them or not when drawing depends upon the graphics functions/library you use. Generally it''s best to create them at the appropriate size because most drawing functions do not support "stretch blits", as they are called, and even those that do will do it slowly as it''s a processor intensive operation to do it well.

[ MSVC Fixes | STL | SDL | Game AI | Sockets | C++ Faq Lite | Boost | Asking Questions | Organising code files | My stuff ]
Thanks Kylo you are my new best friend.

Excellent description of the issue. So as long as I have the correct draw libraries I''m set. I''ll probably get the DirectDraw working first and worry about openGL later. But again thats the noob in me speaking and when I get a coder to help on this project they''ll probably tell me all sorts of better ways to do it =)

Really appreciate everyones input. It helps a bunch.

Mark M.

PS: If you are bored for the next 20 months Kylo feel free to give me a hollar. You work for free right?

Mark MacPherson
Flybynight Studios: Owner
Current Skillsets: Project Manager - Team Lead - Scripter - 2D Artwork - Basic 3D Modeller - Web Development - Marketing - Administration

This topic is closed to new replies.

Advertisement