Newbie with some General Questions..

Started by
6 comments, last by Jammer211 23 years, 10 months ago
Hi. I''m Joe, 15 and just got Sam''s Teach Yourself C++ in 21 days. I have a little bit of progarmming experience (HTML, and I fiddle in BASIC when I was 7 or 8). I''d really like it is someone experienced could answer a few simple questions about the C++ laungauge. 1) How are graphics intergrated? Using DirectX or a software renderer? In BASIC, one had to design the graphics Pixel by Pixel (as far as I know). So how do you integrate graphics? 2)What are the functions of libraries and the .h files (Precursors?) and how do you discover their purpose and commands? 3)What does "Objrct Oriennted" mean? I understand that this is a big difference in C than C++. 4)Where can I find good supplemental tutorials and programs made in C++ to examine? Just my 2 cents.. oh damn! I was gonna spend it on something...
Just my 2 cents.. oh damn! I was gonna spend it on something...
Advertisement
1) DirectX is how graphics are integrated if you want to do windows programming. There is also OpenGL which is probably easier to use then DirectX. If you have read any of that book then I assume you know what functions are. DirectX and OpenGL are basically ALOT of functions that help you draw graphics to the screen. There are lots and lots of articles on this site about DirectX and Nehe's tuttorials on OpenGL are the best I have ever seen.

2)the .h files tell you the function names and how to use them. The actual functions (which is what actually does all the work) are contained within the library. You probably won't be able to see the actual functions inside the library as it is compiled code. Just open the .h files in any text editor like notepad and you can see the function names and it will tell you how to use each one of them

3)Object Oriented: ideally, you would treat everything in your program as an object, or an action you are doing to an object. Each object knows things about itself and things that it can do. Example: say you have a door in your program. The door is an object. It knows it is made of wood, it knows it is 8 feet tall by 4 feet wide. Things it can do: open, close, lock, unlock. An object is something in your program that you can manipulate.


If you are just starting c++ then I think you should code in DOS first. Like get the DJGPP compiler for that. If you already have MSVC or Borland C++ compilers then create console applications instead of windows applications. You will need to learn the basics of c++ before moving on to windows and a console applicatio (DOS) is the easiest way to get started.

Also, I wouldn't even dare looking at DirectX until you know what you are doing in C++ with classes and pointers. It will scare you. It scares me a good bit and I have been coding for a while now.
There are plenty of tutorials on this site, just look around for them

Hope this helps



"Now go away or I shall taunt you a second time"
- Monty Python and the Holy Grail
themGames Productions



Edited by - ncsu121978 on June 13, 2000 5:14:28 PM
1. The way you want them to be. You can use an already made library/API such as DirectX, Allegro or OpenGl, or you could write your own functions to draw graphics (but I wouldn''t go into graphics just yet if I were you).

2. Precursors? I think you mean "preprocessor". Any good compiler should come with documentation over all of the functions and header files (.h files) included with it.

/. Muzzafarath
Mad House Software
I'm reminded of the day my daughter came in, looked over my shoulder at some Perl 4 code, and said, "What is that, swearing?" - Larry Wall
Thanks for your help. But one more quick question (and it will sound REALLY stupid, but here it goes:
Where the heck is the compiler in the Djgpp directory?! I installed it, figuting it would be much simpiler than Microsoft. But I can''t even find the program to run. Are you supposed to code it in notepad, save it as .cpp and then run it through a program? what?! Thanks

Just my 2 cents.. oh damn! I was gonna spend it on something...
Just my 2 cents.. oh damn! I was gonna spend it on something...
quote:
1) How are graphics intergrated? Using DirectX or a software renderer? In BASIC, one had to design the graphics Pixel by Pixel (as far as I know). So how do you integrate graphics?


First, you create pictures in graphics softwares, and save it to a file format (eg. BMP). Then when in C++, you write lines of code that load the file into memory and then draw it by calling functions (either created by yourself or using an API, eg. DirectX)

quote:
2)What are the functions of libraries and the .h files (Precursors?) and how do you discover their purpose and commands?


The .h files act as the index (or table of content) of a book. And libraries (or source file) like the content of the book.... err.... anyone have a better explanation?

---------------------------

DJGPP don''t have an Integrated Development Environment (IDE) which is = {editor + compiler + debugger + misc} in one place. DJGPP is just a compiler. But RHIDE (yes, it''s an IDE) is one TurboC-like IDE for DJGPP. You can douwnload it from the DJGPP homepage.


Yawnn...... sleepy. c ya.
"after many years of singularity, i'm still searching on the event horizon"
In Basic, there''s commands like Line, Circle, that draw shapes, but you might as well use directx and C++...
It''s a lot better...As others have said, you can read in .BMP files that you make for pictures with Directx....
Need help? Well, go FAQ yourself. "Just don't look at the hole." -- Unspoken_Magi
Hey Jammer-
Get RHIDE. Its an IDE for DJGPP. You can find it at http://www.delorie.com.

Saran Edorir
M


P.S. The longest part of writing this response was choosing the little icon. There are so many...
to compile a program with DJGPP do this
open an MS-DOS box (START->Programs->MS-DOS Prompt)
change to the directory that your source file is in
if it is c++ then do this gxx filename.cc -o programName.exe -lalleg
if you are not using allegro then you can leave off the -lalleg

just write your source code in notepad and save as .cc file


"Now go away or I shall taunt you a second time"
- Monty Python and the Holy Grail
themGames Productions

This topic is closed to new replies.

Advertisement