Solved

Graphics in C++

Posted on 1998-09-24
30
490 Views
Last Modified: 2013-11-19
I need headers that handles fast graphics in C++
(640x480x16M or more, with windows,menus and mouse...)
and display bitmaps (GIF, PCX, FLI... ).
0
Comment
Question by:yyyannag
  • 8
  • 7
  • 5
  • +5
30 Comments
 
LVL 2

Author Comment

by:yyyannag
ID: 1173675
Edited text of question
0
 
LVL 1

Expert Comment

by:TheMadManiac
ID: 1173676
do you mean header or LIBRARY?????

a header usually describes what is on and how to use a library or some other source with code. i could send you 1000's of headers, with which you probably couldn't do jack ****, since you don't have the accompanying source code,

also, it might be nice to tell us what compiler/OS (target, not the one you develop on!) you use
0
 

Expert Comment

by:euclid091498
ID: 1173677
What O.S. are you using?
Are you interested in 2D or 3D graphics?
You say you need 'headers', do you mean header (.h) files?
There's a lot more to a graphics library than just the headers.
Can you clarify?



0
 
LVL 22

Expert Comment

by:nietod
ID: 1173678
That's a useful answer.
0
 
LVL 2

Expert Comment

by:gysbert1
ID: 1173679
I must say, I bet yyyannag now knows exactly what to do !

euclid: You are not supposed to lock questions with answers that have no hope in hell to be accepted ! Your answer falls in the same class as "I am sure I know what the answer is, I will go look it up is a book and return with the data in a few weeks ..."

yyyannag,
I suppose you want to use Windows. I would like to know what kind of graphics you want to do. Fast graphics is a very relative thing. Give bit of detail as to what you want to accomplish. The native libraries available in Windows will be sufficient in most cases. If not you will have to have a look at libraries that implement DirectX and/or MMX technology.

Have you seen the game Unreal yet ? It is all done using DirectX and MMX in Windows and it is the best display of lightning fast graphics I have ever seen. (Much better than quake which did not even use MMX or DirectX and was still pretty good)

I guess the question that remains to be answered is what you want to do ...
0
 
LVL 2

Expert Comment

by:gysbert1
ID: 1173680
euclid, I see that you are new to EE.

The following applies to answering questions.
1) Do not post an answer that you know will not be accepted. That belongs in a comment.
2) If you want some more information, put that in a comment and it will be answered.
3) NEVER post somebody else's last comment as an answer to the question. In my eyes that is stealing and should be punishable by death !

Remember that if you lock a question by answering instead of commenting the majority of experts will see that the question has been answered and not even bother to have a look at it. You are thus depriving the user of valuable comments and tips that could solve his problem.

I am sure you did not mean to be rude posting that answer.

Hope that sets everything straight.

Gysbert1

0
 
LVL 22

Expert Comment

by:nietod
ID: 1173681
Actually, gysbert1, I suspect this is not for windows.  Since he mentions explicit screen modes, I suspect we're talking about a game for DOS.
0
 
LVL 2

Expert Comment

by:gysbert1
ID: 1173682
I am prepared for that! That is why I mentioned Unreal and Quake, I want to convince him to use Windows for his own sake :o)

In my opintion the days of DOS games and Mode X were numbered and are way gone today ... (Although it was fun while it lasted !)

0
 
LVL 2

Author Comment

by:yyyannag
ID: 1173683
I use Borland C++ 3.0
and I do want to use windows.
I prefer to use 3d graphics although it is not accential.

0
 

Expert Comment

by:euclid091498
ID: 1173684
nietod, gisbert1:

Of course it should have been a comment, not an answer. My mistake, thanks for the remarks.

yyyannag,
What exactly do you want to do, it still sounds too vague...
0
 
LVL 2

Expert Comment

by:gysbert1
ID: 1173685
Ok, now we are one step further. You will have to tell us what you want to draw. If you want to paint bitmaps onto the screen that is a totally different story from drawing a 3D vector drawing. We also have to get enough information to determine if using DirectX / MMX is necessarry or not ...

PS. I suppose you are using OWL then ?
0
 
LVL 6

Expert Comment

by:snoegler
ID: 1173686
DJGPP (Dj Delorie Gnu C++) offers 32bit DOS extender VGA graphics support(strange phrase :-), i have only worked for a short time with it, but i think it could
be possibly one solution for you - it is compatible to the ANSI C++ standard and has some
extensions, i think most of your console Borland C++ code should work without changes.
If you like, i can give some links.
0
 
LVL 6

Expert Comment

by:snoegler
ID: 1173687
(I forgot to mention that you'll have to do menus & windows by yourself when using DJGPP)
0
 
LVL 2

Expert Comment

by:gysbert1
ID: 1173688
Not to mention the mouse ...

That is why I would go for Windows rather than DOS. It is going to save you a lot of time, although it is good experience to do it in DOS once so you can appreciate what Windows does for you a bit more ...
0
 
LVL 22

Expert Comment

by:nietod
ID: 1173689
snoegler, I think this is for a standard windows application, not a console.

yyannag, are you familiar with Windows programming?  have you written any Windows programs?  that is where you should start.  Then if window's standard graphics procedures are n't fast enough or powerful enough for you, look into directX.
0
Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

 
LVL 1

Expert Comment

by:andla
ID: 1173690
I'm not familiar to Borland C++ i'm using MSVC++ 4.x, but if there are almost none difference i saw a sample of loading a pcx file and viewing it in a window. If you want it i can send you the files. I don't remember where i saw it. This sample code is class and objects and i'm not used to program that. I read a book some time ago about handling classes but it only dealed with iostream.h family. What the heck i want to learn to program cool 3d graphic to. But you will need DirectX, if you have Win95. I have heard that Windows NT used that to ?!

Hmm. I hope i press the comment radiobutton! :-)

Your sincerely
Andla
0
 
LVL 2

Author Comment

by:yyyannag
ID: 1173691
Yes, I want to draw bitmaps onto the screen, but I need it to look in 3D.
I prefer 3D graghics because I prefer not only to draw an object but also manipulate it...
0
 
LVL 2

Expert Comment

by:gysbert1
ID: 1173692
Does that mean you want to create the bitmaps yourself or do you want to load bitmaps from somewhere and display them ?

If you want to create them yourself you will need good libraries. Maybe even OpenGL or something while it is very easy to just draw 3D (pre-created) bitmaps onto the screen.
0
 
LVL 2

Author Comment

by:yyyannag
ID: 1173693
I am sorry I haven`t been more detailed. I will write my request now :
I guess you have all seen simcity 2000. It uses 3d graphics (the game can work from 4 different angles. I`m looking for this type of graphics : 3d graphics, where I can draw 3d objects, and look at them from different angles. I`m trying to create a game that is similiar to simcity 2000, If you havn`t got it by now.
In addition, I want the ".H" file to be able to load pictures from the most common extensions : gif, bmp, pcx, and whatever else you can find.

Once anyone of you send the appropriate answer, the points are yours.

By the way, I`m using windows 95 and visual c++, although c++ version 3.0 answers will be accepted gladly.

Thanks, I hope I was more detailed now.
0
 
LVL 2

Expert Comment

by:gysbert1
ID: 1173694
I hope you realize how much work that is going to be ! Games with graphics comparable to SIMCITY takes a whole team of highly skilled programmers months, even more than a year, to program and that is mostly due to the complexity of the graphics.

All the libraries I have ever seen only give you the ability to draw lines/polygons (and a few things like ovals ...) So the bulk of the work will have to be done by yourself. You will e.g. get a DrawLine(x1,y1,z1, x2,y2,z2) function in more advanced libraries while the native C++ libraries only supports DrawLine(x1,y1,x2,y2) but definately NOTHING that allows you to do say DrawFunkyLookingHousLikeStructure(). Getting libraries that display all the image formats is fairly simple but that seems to be the least of your problems. All these libraries do is PutPixel(x,y) after decoding the image format.

I can tell you that even the native windows GDI will most probably be fast enough for your purposes so the fast part will definately not be your problem (unless you want doom-like characters running around in your 3D world at 30+ fps!).

The difficult part is calculating WHAT to draw and not the drawing itself ...
0
 
LVL 1

Expert Comment

by:hotsextoy
ID: 1173695
   He's rite, that does take alot of work, coding, debugging, etc.  for that type of game...u'll never make it using libraries that are included with vc++, for something like that u have to make ur own graphics engine to handle it the way you want it..but i guess ur in hurry, in that case then ur better off using something more standardized for the graphics portion like OpenGL, that should work nice as far as simplicity, if it's too simple move up to Direct X libraries...that should be sufficient.  The video is also handled by Direct X (as far as resolution and color is concerned, as far as mouse, kbd data, VC++/MFC has standard libraries for that as well as Direct X.  IO of files can be done with VC++/MFC but only windows standards like BMP files, WAV files, although Direct X can handle a few more...anyhow even though i gave u ideas, ur in over ur head for the moment, but this is the best learnin experience, doing somethin that is nearly impossible (alone)
                                                                                               pat b

0
 
LVL 2

Author Comment

by:yyyannag
ID: 1173696
Thanks, Pat B, but This wasn't exactly the answer I was looking for. You did, however, convinced me that it is not impossible to do it (draw 3d houses) by myself, and therefore I rephrase my question : I'm looking for a Borland C++ version 3.0 library, which enable me to draw even the simplest lines and boxes, ovals etc, as well as menus, windows etc. I have overcome the 3d part.

Secondly, you didn't at all regard the loading pics and sound playing category. Please include them too.

I hope now my question will be answered more effectively. These are the most important parts of the question.

Thanks,
                yyyannag
0
 
LVL 6

Expert Comment

by:snoegler
ID: 1173697
The only non-commercial 'tools' are GDI(part of Windows SDK) and DirectX.
GDI as well as DirectX can load and manipulate graphics/lines/3d/... easily, but you'll need
to draw them before :)
0
 
LVL 2

Author Comment

by:yyyannag
ID: 1173698
how can I get GDI ? How do I use it and DirectX ? Does it involves also C++
Programming ? I need more info. you all keep giving me good comments, but I need more information.
0
 
LVL 1

Expert Comment

by:andla
ID: 1173699
If you have a slower modem as 28.8 and want to download DirectX you will probebly wait the whole day. It's funny these Microsoft products get bigger and bigger and you buy a bigger and bigger HD and you don't really get any more space on you HD when you are uppgrading the microsoft tools.

I haven't not yet tested the full power Direct X libs but i heard it's Cool. If you want cool 3D you should look at texturemapping. That was the revolution thing some years ago when wolf,duke,quake and so on released.
0
 
LVL 6

Expert Comment

by:snoegler
ID: 1173700
DirectX is a library which gives you direct access to the graphics card. Functions which are
not supported by you graphics adapter are emulated by DirectX.
It consists mainly of these components:
- DirectDraw, which gives you direct access to the screen.
  You can draw then using either GDI functions(see below) or using the internal methods of
  DirectDraw. These are very limited, but *very* fast (mainly bit blitting)
- Direct3D. You'll need much time, much coffee, and you should buy a 3D modeller for
  Direct3D. It is almost impossible to give you a short overview of it, but i'll try it:
  There are 2 modes supported: 'retained' and 'immediate'. In 'retained' mode, you just
  show already present 3D object, can rotate/enlarge/..., but you can't modify them directly.
  In 'immediate' mode, you'll need to draw each vertex/line/polygon using the Direct3D
  functions. It isn't as hard as it sounds, but you'll really need time to learn it.
- DirectInput. Allows you to access keyboard/mouse/joystick/feedback devices directly.
  Is really powerful.
- DirectSound. Quite powerful abstraction to sound hardware. Combined with Direct3D, you
  can even create 3D sounds.

GDI is the standard windows 'Graphics Driver Interface'. This is included with every windows
compiler (it is part of the windows kernel).
It is covered by the MFC class 'CDC'.

If you need more information on one of the topics, sure someone can give it.
I have some experience with DirectX, so perhaps i can help you on this topic.
0
 
LVL 2

Author Comment

by:yyyannag
ID: 1173701
Thanks, snoegler, your answer was very good, although I'm having little problem obtaining visuall c++, and I guess this answer doesn't relate c++ for DOS. However, I'd like to give you the points, and ask you for your E-mail, so that I can talk to you about the use of DirectX and GDI  in general. To receive the points, submit your comment as an answer, And I'll give you the points.

Thanks again,
            Yaniv.
0
 
LVL 2

Author Comment

by:yyyannag
ID: 1173702
Is there a DirectX tutorial or HandBook that I can get ?
0
 
LVL 1

Expert Comment

by:andla
ID: 1173703
I think there was a tutorial with the files when you download it. But why read a handbook??? You can learn everything you want to know in experts exchange ;-)
0
 
LVL 6

Accepted Solution

by:
snoegler earned 300 total points
ID: 1173704
Thank you :)
My email is alexander.berthold@rol3.com, feel free to ask what you want.


0

Featured Post

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

Templates For Beginners Or How To Encourage The Compiler To Work For You Introduction This tutorial is targeted at the reader who is, perhaps, familiar with the basics of C++ but would prefer a little slower introduction to the more ad…
Introduction This article is the first in a series of articles about the C/C++ Visual Studio Express debugger.  It provides a quick start guide in using the debugger. Part 2 focuses on additional topics in breakpoints.  Lastly, Part 3 focuses on th…
The viewer will learn how to clear a vector as well as how to detect empty vectors in C++.
Add visuals to your Prezi to keep your audience engaged. Learn how to embed images, edit them, and more in this video micro tutorial. Select "Insert" from the top menu in your Prezi editor: Select "Image": A toolbar will pop in from the right …

708 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now