Dev-Spot Developer Forums
September 05, 2010, 02:16:02 PM *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
News: Welcome to the LearnCpp.com forums!  Enjoy your stay.
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: Graphics... ugh.  (Read 636 times)
IAmSerge
Newbie
*
Posts: 17


View Profile
« on: February 08, 2010, 02:37:17 AM »

Ok.  I'm sick of having to search everywhere with inconclusive results.

I'm trying to work with C++ and the directX sdk in some manner to create a 2d graphics engine (or atleast, part of one for now).

But I've come upon some major problems:

DirectDraw, despite being quite simple to find help and solutions on, is 100% outdated as most of you already know.  DirectDraw is out of the question.

Direct3D, although capable of doing 2d by drawing everything on the same plane, is not going to be what I want, because (from everything I've been able to find) it still uses a 3d view, which can distort images that are drawn.  I'm looking to be doing things pixel-for-pixel, exactly as they were sprited to be.  I've searched, but could not find, anywhere that could help me use Direct3d in a form that is 2d.

Well, i DID calculate out that if i set the viewing angle to 90 degrees (wide), and set everything on a plane that was at a depth of 400 in relation to the 'camera', that it SHOULD be a pixel-for-pixel view, if the resolution is 800 by 600.  But I still do not trust nor want this, because I want to directly draw to the "screen" (well, not directly, but in a manner that is not indirectly calculated by 3d viewing).

If someone has a solution for using D3D in a 2d mode, please send me a link and/or let me know

The 3rd option I've tried is to learn Direct2D, and while I have successfully used it to draw onto the screen, I have found absolutely no guides for it on the internet, other than the one on msdn (which sucks, horribly).  When it comes to sprites, I BARELY found an example program which used images loaded from files and such, but it was so damn confusing and overly complex that it would take way too much time to sift through everything that the program fails to teach me.  Also, apparantly many developers just hate D2D, for a variety of reasons.


I was recently referred to Allegro (by recently I mean within the hour), and was told it was simplistic.  Albeit a sigh of relief, I wish to know how it performs in comparison to using directX directly. 

I wish to know the forum's opinions and suggestions on everything I mentioned.  But more appropriately, I really just wanted to be pointed in the right direction

*sigh*  Embarrassed

-Serge
Logged
tylerfb11
Full Member
***
Posts: 161


What have I gotten myself into?


View Profile
« Reply #1 on: February 08, 2010, 01:11:58 PM »

Hey,

If you are intending to use 2D graphics throughout the entire program, ditch the Direct 3D idea. 3D libraries are a lot more complicated than 2D ones, and if you don't need the 3D functionality, useing a library that supports them is pointless. I'd suggest ethier Allegro or SDL. They are both quite simple and easy to use. Although Allegro is slightly simpler than SDL, it is (slightly) outdated. But this outdated-ness hasen't affected me as of yet in my use of it. Personaly, I'd suggest Allegro, although SDL is also a good option should you choose to take that path. On a sidenote, people around here seem to know more about Allegro than SDL, so if you are indending to stick around these forums, Allegro might be the better option becuase that way we could be of more assistance, should you run into a problem.

-Tyler
Logged

There are 001100010 kinds of people in the world, those who understand binary, and those who don't.
IAmSerge
Newbie
*
Posts: 17


View Profile
« Reply #2 on: February 08, 2010, 05:31:29 PM »

considering I plan on doing 100% sprites and sprite animation, no graphical effects and such, after I set up the "engine" to work the way I want it, I will have a few problems, probably, but not too many, I'm sure...

But yeah, I looked up Allegro and... well, the website spoke of it as a game engine.  I really just want a graphical engine (and sound engine too) and then do everything else myself.  Or am I misunderstanding, and Allegro can be exactly what I want it to be?


Ok, just got Allegro.

And first thing's first, the instructions/methods to install it are... well, lacking in simplicity, and cannot seem to figure out what the balls I am supposed to do.

I have all the files, I don't have djgpp or whatever its called... 

I am using windows 7, and MSVC++, and I just want someone to tell me, hopefully in a 3-step process, what I am supposed to do >.<, and it would be much appreciated if it didn't involve any "if"s, "and"s, or "but"s.

Also, 1 more question:  Will I be using allegro with windows.h?  Or does it instantiate it's own window?  I could probably find this out by finding an example file, though....
« Last Edit: February 08, 2010, 05:58:07 PM by IAmSerge » Logged
tylerfb11
Full Member
***
Posts: 161


What have I gotten myself into?


View Profile
« Reply #3 on: February 09, 2010, 02:02:32 PM »

heh heh...

Alright, Allegro is commonly refered to as as game engine yes, but remember, any game uses graphics (and quite often sound). So therefore any game engine can be used to display graphics and sound. basicly, a game engine is pretty much just a graphics engine thats been "spruced up" a bit for conveince. And if you really don't like some of it's "conveince" functions, you can always ignore them and write yor own.

now, for installing...

I myself use DevC++, so my instalation was automatic using a DevPack. But seeing as most compilers work simlar to each other, I should be able to giude you through it manually. Alright, here we go...

STEP 1:

Open up the folder where you currently have all of the allegro files saved (if it is compressed i'd suggest un-compressing it now). Now go into your hard drive \ program files, and locate the MSVC++ folder (if you are running a 64 bit version of windows 7, andMSVC++ is a 64 bit program, it'll be in "program files", if it is a 32 bit program <-- more likley, it'll be in "program filesx86").

STEP 2:

Once you are in the MSVC++ folder, there should be a folder called "lib" or "library", or somthing along that line. Open this folder. copy all of the Allegro files into this folder.

STEP 3:

Now, go back into the MSVC++ main folder, create a new folder called "allegro", go into it, and copy all of the allegro files into this location as well.

STEP 4:

By now you should have two copies of all the Allegro files, one copy in your library folder, and the other copy in your allegro folder. In your allegro folder, locate a file called "alleg42.dll" (or somthing close to that, i'm working of the top of my head here so that name might not be exaclty correct, but I know that there is only one .dll file for Allegro, so that should give you a good enough lead). Right click and copy this file.

STEP 5: (almost done)

Back in your MSVC++ main folder, there should be a folder called "bin", go into this folder. Once inside, check to see if there is a folder called "dll" or "extention", if there is, then paste the file you just copied into that folder. If there is no folder called "dll" or "extention", then just paste it right into the "bin" folder (the one you are already in).



Well, that should be it for installation. I tried to cut down the "if's", and's", or "but's" as much as possible, but some of them were inevitable. And note that, if for some reason, Micrsoft decided to be stupid tards and make the program run completely different than most other compilers, this guide may be wrong. If this is the case, you'll have to give me a detailed discription of the MSVC++ folder layout in order for me to help you. Or you could just ask uncle Google.

And one one last note, Allegro handles the window proccedure on it's own, so there is no need for "windows.h". And t handles it's own I/O, so there is not need for <iostream> ethier.

hope that helps,
-Tyler
Logged

There are 001100010 kinds of people in the world, those who understand binary, and those who don't.
IAmSerge
Newbie
*
Posts: 17


View Profile
« Reply #4 on: February 09, 2010, 03:39:32 PM »

Hmm.. its own window.

In that case, if I compile a program on windows, what other OS's are capable of running it, if I'm using allegro?

oh, and I can't seem to find the allegro .dll.

I'll see If I'm good without it, then come back and edit if theres a problem or not.

Edit: apparantly I didn't paste the files into the right folder, considering it gave me an error that the allegro.h doesn't exist.

I pasted them into the Microsoft SDK/ v7.0 folder, because I couldn't find the folder for c++ stuff or whatever within MSVC (Im actually Microsoft Visual Studio v8, but I think thats the same thing. *shrug*)

But that didn't work, so ill get rid of it from there, and hopefully I can find some other way to do it. =/

Perhaps the "C" folder?  but... I'm afraid that its actually a folder for "C" and not "C++"

Any suggestions?
« Last Edit: February 09, 2010, 03:53:12 PM by IAmSerge » Logged
tylerfb11
Full Member
***
Posts: 161


What have I gotten myself into?


View Profile
« Reply #5 on: February 10, 2010, 02:12:23 PM »

I'm not sure about the OS thing, I've never tried it.

I did some snooping around on the net for you and I found a pretty good guid on instalation: http://csfinch.wordpress.com/2008/04/25/setting-up-allegro-422-in-visual-c-08/


hope it helps.
-Tyler
Logged

There are 001100010 kinds of people in the world, those who understand binary, and those who don't.
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.11 | SMF © 2006-2009, Simple Machines LLC Valid XHTML 1.0! Valid CSS!