Hello everyone,
This is my first post. A week a go I didn’t know C# existed
and only had heard the term “Direct X”, but never knew anything about it. 5-6
days a go I accidentally stumbled upon the 8 part C# RSS reader video tutorial
(Done by learnvisualstudio.net, but hosted at Microsoft). I watched most of
that and became quite interested in trying C#, so I downloaded C# express
edition. Later I read a bit about DirectX, which made me really, really, really
want to make a game. Since then I have been devoting about 4-6 hours a day to
learn C# and DirectX. I have learnt a
lot, but I am definitely extremely new.
The first thing I have to show for almost a weeks work is just a color changing
triangle which follows your cursor. I have uploaded a .zip of the source and a
screenshot:
http://esnips.com/web/csProjects
The code is pretty heavily based on Tutorial 2 in the DirectX SDK, but all the
parts I didn’t write I spent a long time trying to familiarize myself with it.
I know it's a huge thing to ask, but would someone experienced be able to go
over the code and tell me everything that's not done "the best way"
As, I don't want to develop any “bad habits”.
That asked, I've got a few questions.
When I run my program, it also opens up a console window ... how do I get rid
of that (Probably more of a C# question)
The game I am trying to develop is very similar to 'n game' which is a 2D
action platformer (Screenshots are available here:
http://www.harveycartel.org/metanet/n_screenshots.html). It's a very smooth,
enjoyable, simplistic 2D game. I'm hoping to try make something pretty similar.
I've talked to a few quasi-programmers, most of them tell me I should learn a
real language like c++ and not use managed code because it's too slow. I'm not
really sure what to do. I think the game I am attempting is simplistic enough
so that it shouldn't matter, but I am still worried I am "wasting my
time".
Third question: Objectively would you say DirectX is suitable (not capable, but
suitable) for developing my 2D game Do you know any other graphics thingies
that's would be better Honestly, I'm been trying really hard to understand DirectX,
but I just can’t make heads or tails from almost all the documentation. And I also
have trouble finding good DirectX tutorials which are specific to what I am
doing. So I’m wondering if there is a more suitable API for complete beginners
like me.
Almost done, I’m looking for some source for C#/DirectX that would simply draw
on screen a few different primitive shapes at the same time. Just something that
would draw a couple of ellipses, a couple of polygons and a few rectangles (all
the same time) on the screen. I just want the shape outline, and at simple as
possible. Anyone know where I could get something similar from
Last thing, where should I go from here What should I be trying to learn , trying to make , trying to do
Thank you SO much, I really appreciate any replies.
Thank you.
Eric Springer.

Where to go?
Geert Porteman
GDI/GDI+ is the more "traditional" way of doing graphics in the Windows environment. I've not personally used GDI+, but the older GDI was never the best when high performance was a requirement
Whether performance is an issue or not is difficult to say - there are a huge number of factors involved.
As for learning the API - I'd say that comes down to practice. It's been a while since I started, but in the early days I used to just copy-n-paste the DirectDraw initialization code (all 300+ lines) without really knowing what or why it worked. As time went on I started to piece bits of it together...
hth
Jack
callvishnu
Hi,
Welcome to the WGGT forums - hope you enjoy your stay
Regarding your code link... I personally don't have the time to download and read over it (and I'm a little cautious about downloading random code off web forums!). Maybe someone else reading this thread will have time though.
Ignore them. You aren't wasting your time - in fact, I'd go so far as to say that learning C++ as well as DirectX as well as games development would be a bad choice.
Its a bit silly really, but you get a lot of Real Programmers that avoid things like C# for no particularly good reason..
I spent my first few years working with VB6 - it allowed me to focus on the high-level parts and it allowed me to complete countless number of games. C++ has its uses (its now my primary language) but you will spend a lot of time on the implementation rather than the solution.
I probably cant talk objectively as I'm very much in the DirectX fanclub
but you'd do well to specify your other technologies... for example, if you want to stick with C# then you have some different choices than with C++. Things like OpenGL (I believe there is a .Net wrapper), GDI and GDI+ will all do the sorts of graphics that you want. Under Windows and .Net I'd say that Direct3D is by far your best choice though.
Are you having trouble understanding the source code and the API, or the actual graphics theory It could be worth picking up a textbook on general graphics algorithms and theory if you're stuck on the latter.
ZMan and/or Pieter might well have some better information to add, but you could go a long way by pointing your browser at http://www.thezbuffer.com/ and http://www.pieterg.com/
hth
Jack
Smurfy
I was thinking about GDI/GDI+. How would that compare It seems to be a lot simplier, but I have heard it's slow .... is that an issue
Mainly the code and API. I'm now at the stage where I know almost all the arguements and methods that are used to draw a triangle on screen, but most of time I don't understand why or what it does ... I just know that I have to do it.
I guess it'll start to come as I spend more time with the API.
Thanks a lot, I really appreciate your reply.