Archived

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

3d Wolf

Draw a pixel in C++

Recommended Posts

Shelrem    134
Uhh, i hate to do this, but since this thread already exists on this board (please read the messages before posting), i don''t feel so bad doing it.

Check www.libsdl.org and look at the tutorials. Granted, SDL is in C, not C++, but as you don''t really need object orientation for drawing a pixel, i don''t think this should be that much of a problem for you.

Unless, of course, you don''t know C++ or C, in which case you''ll want to start with something a bit simpler... There''s a free book on learning C++ at http://www.bruceeckel.com/ThinkingInCPP2e.html. Once you get through that, then you should be ready to start thinking about games.

-benc

Share this post


Link to post
Share on other sites
LearFox    122
C++ is a programming language alone, it''s purpose is
provide the `meat'' between IO layer languages that work
with C or C++.

You have three options at this point, you can interact
with the Linux kernel''s video IO and attempt to draw
a pixel (most difficult approach and not recommended).

Use either SVGALIB (library) for fulll screen drawing
or XLib for GUI drawing (you''ll be drawing to a Window
on a GUI enviroment).

A more experimental approach is to use a proprietery
library such as (previously recommended) SDL. This is
perhaps the best approach but most limited and
difficult to set up.

XLib would be my recommendation as it gives you
direct access to the GUI (X windows) at the lowest
possable level and not require players to install any
additional libs (SDL is hard to set up and get
working at the moment). SDL games I''ve seen were not
very impressive, but it''s a good start for beginners.

Share this post


Link to post
Share on other sites
Nurgle    269
EXCUSE ME?!?!?!?!

SDL is shitloads better than Xlib for simple graphics, especially if you''ve ever done any DirectX coding...

Xlib adds way too much complexity, while SDL acts as a wrapper for several technologies, including GGI and DGA.

Share this post


Link to post
Share on other sites
LearFox    122
I didn''t imply that XLib should be choosen over SDL
for everyone. I''ve worked with X, Windows, and many
portability libs/SDL for a couple of years now.

I may not have the best experiance but I do have a
development team with more than 20+ years of experiance.
We agreed that Xlib provides a better lower level access
for graphics for game development at a major cost of
coding work.

SDL does have some limitations, a lack of X style event
handling, multiple toplevel windows (though newer
versions may support it now) and network transparent
game input and sound device support.

SDL''s advantages in coding simplicity and is a good
start for newbies. There are pros and cons for both
choices based on my experiance and those I''ve worked
game projects with.

Share this post


Link to post
Share on other sites