This is a pretty simple request, I hope.
I have Visual C++ (Which I've gotten rather good at)
and DirectX SDK.
I've programmed a bunch of 2D stuff in other languages, but so far I've only been capable of text-based games in C++.
I learned that C++ doesn't do graphics on its own, and DirectX is required.
So I was browsing the samples that came with it, hoping to dissect one of them, and learn how it worked.
The only problem is that the "simple sample" they included, consisted of over 15 different components (.cpp, .h, .etc)
I would just like a program that uses DirectX and draws a basic window on screen, and then a sprite in that window.
The more simple the better, I want bare minimum, just so I can pick it apart line for line and learn how it works.
Simple 2D Example
Started by OutcastOrange, Sep 18 2009 11:58 AM
10 replies to this topic
#1
Posted 18 September 2009 - 11:58 AM
|
|
|
#2
Posted 18 September 2009 - 02:35 PM
If you're using Visual C++ than you might as well just use Window's GDI+ since your not worried about cross platform compatibility.
Check out the example on this page to get started.
Note: The reason I'm suggesting GDI+ over DirectX is because DirectX is mainly for 3D graphics, it can still draw 2D graphics really well, but it's a lot harder. GDI+ on the other hand is strictly for 2D graphics (I think).
Check out the example on this page to get started.
Note: The reason I'm suggesting GDI+ over DirectX is because DirectX is mainly for 3D graphics, it can still draw 2D graphics really well, but it's a lot harder. GDI+ on the other hand is strictly for 2D graphics (I think).
#3
Posted 18 September 2009 - 04:48 PM
If you help me out this one time, you very well may save my future!
Please dear friend, how do I follow this new GDI+ path?
It sounds so new and shiny.
Perhaps you know a better way to bridge the gap?
I long for a clear reply.
PS: Don't worry, I've just had a few perspective realizations and now reality seems to be fleeting from me.
Please dear friend, how do I follow this new GDI+ path?
It sounds so new and shiny.
Perhaps you know a better way to bridge the gap?
I long for a clear reply.
PS: Don't worry, I've just had a few perspective realizations and now reality seems to be fleeting from me.
#4
Posted 18 September 2009 - 11:00 PM
What are you having trouble with specifically? The example and references on MSDN should be pretty helpful, but perhaps you're having difficulty with the actual language?
#5
Posted 19 September 2009 - 09:53 AM
I know how to make loops and use headers and reference libraries for my text based games.
I need to learn which libraries I will need for 2d programming, and then some basic commands for:
-Creating Sprites
-Hide/Show Sprites
-Change Sprite Image
-Change Sprite Position
Then I can really throw down some awesome.
Thank you for all of your help, I intend to learn more about GDI+ today.
I need to learn which libraries I will need for 2d programming, and then some basic commands for:
-Creating Sprites
-Hide/Show Sprites
-Change Sprite Image
-Change Sprite Position
Then I can really throw down some awesome.
Thank you for all of your help, I intend to learn more about GDI+ today.
#6
Posted 19 September 2009 - 10:03 AM
For 2D stuff I like SDL which has quite a bit of community support. The software library is open source and Lazy Foo' Productions has a good tutorial for setting it up and getting to blit surfaces and render fonts as images, amongst other things.
There are a many SDL tutorials out there to affiliate you with its basic concepts.
There are a many SDL tutorials out there to affiliate you with its basic concepts.
#7
Posted 19 September 2009 - 01:04 PM
This is a guide to GDI+ using Visual C++ that does an excellent job at explaining everything. Read through it all and you should get a start.
Visual C++ GDI: Introduction
Look under the heading GDI Fundamentals and all other subjects in that row.
Visual C++ GDI: Introduction
Look under the heading GDI Fundamentals and all other subjects in that row.
#8
Posted 20 September 2009 - 09:28 AM
I've been browsing the stuff you guys suggested, and I've learned quite a bit.
I found this at brownhead's link:
What am I supposed to get out of "single document application based in CView"? That means gibberish to me.
Please advise.
I found this at brownhead's link:
Quote
1.Start a new project and name it Bitmap1
2.Create it as a Single Document application based on CView
3.In the Class View, expand everything and access the CMainFrame::PreCreateWindow() method.
2.Create it as a Single Document application based on CView
3.In the Class View, expand everything and access the CMainFrame::PreCreateWindow() method.
What am I supposed to get out of "single document application based in CView"? That means gibberish to me.
Please advise.
#9
Posted 20 September 2009 - 10:31 AM
I'm guessing it's a project template. Hit New Project and then see if you can find something that sounds like that in the list of templates. But I'm not positive.
#10
Posted 20 September 2009 - 01:18 PM
That's what I thought too. I tried a few different templates that sounded similar, and didn't get anything like what it describes...
I wish there was a step-by-step out there somewhere.
I did search extensively before posting on this forum the first time though.
I wish there was a step-by-step out there somewhere.
I did search extensively before posting on this forum the first time though.
#11
Posted 20 September 2009 - 02:19 PM
Keep looking through MSDN and google I suppose. You should find some other examples. But I'm afraid I don't have any good examples on my computer to give you :(.


Sign In
Create Account

Back to top









