Some questions.

Started by
3 comments, last by Methisto 20 years, 8 months ago
A. I have recently started programming a pong clone. I already have Tricks of the Windows Game Programming gurus (1st edition), Focus on 2d on Direct3d and I have recently bought Programming Role playing Games with DirectX. I have uninstalled the old DirectX 6.1 SDK and I have installed the newer DirectX 8.1 SDK. I have started programming the game at 800x600 in 16bit mode. I used the old DirectX 6.1 SDK documentation and the code from the Tricks book. My question is: it is worth to use the old DirectDraw interfaces and don’t use the newer Direct3d for 2d? DirectDraw is a very powerful interface. Unfortunately I don’t have the DirectX 7 documentation (I actually have it, but its in doc form not html) and I have to use the 6.1 SDK docs. Also I have to make lot 16bit conversions, because the Tricks book is based to 8bit. On the other hand I can do 2d games with Direct3d 8.1’ I have the docs and the books for help. It may also help me to understand direct3d so I can easily make a simple 3d game in the future. As you can see I am little bit confused. I just want to make some simple games and I really want to use little old code and don’t just write new rendering – sound – input etc part for the new game. For example I want to make a pong clone and next a breakout clone. In pong I ‘m thinking to make 2 simple rectangles for the paddles a square for ball add some text for scoring and maybe loading a 16 bit bitmap for the game logo. Also I want the ball to be clipped when it touches the left or right side of the screen. I don’t want in one frame to draw the ball and next frame to disappear’ if it is possible I prefer a smooth transition. So when I want to write the breakout clone I use some old code from the pong game and I don’t rewrite the graphics engine. I just draw more rectangles and load from a file some brick textures and maybe a ball and a player ship texture. Is it possible to do this easily with Direct3d interfaces or I have to stick with DirectDraw? B. Ok this may be a silly question, but really want to know: It is possible to break your monitor just programming games with direct Draw or Direct3d? My monitor has broken and I have already sent it to fix it. I just played games, serf the net and programming with DirectDraw.I have only initialized direct draw, set cooperative level, Display mode and created successfully a primary buffer and buck buffer. The only function that failed was a Blt function. I don’t think that I have broken my monitor (to let you know it had some problems with brightness and also making some noise) but it is possible to break your monitor with just making a small mistake in your code? (My graphics card is running fine) Thanks and sorry for my English (I need a lot of practice!) #include < Black Liquid Studios > [edited by - Mephisto on August 19, 2003 3:52:31 PM]
Advertisement
<< As you can see I am little bit confused. I just want to make some simple games and I really want to use little old code and don’t just write new rendering – sound – input etc part for the new game. For example I want to make a pong clone and next a breakout clone. >>

My opinion, why use Direct3D for a Pong or Breakout clone. For your 2D stuff, with Win GDI and today''s computers you can move a zillion objects around the screen fine at 30 frames a second no problem. I did an asteroids clone with Win GDI that is perfectly smooth, with up to 60 asteroids, and pixel explosions.

My strategy to learn this game stuff (this assumes a good knowledge of C/C++)

(1) make a couple 2D games in Win GDI only (know your game loop, learn some Win32, and develop a "style" for your C/C++ programming)

(2) THEN learn some 3D concepts and math and OpenGL functions

(3) THEN learn Direct3D, which is the "standard" nowadays for 3D and XBox (which uses a variation of DirectX 8 I''m told).

No need to put the cart before the horse and do Pong in Direct3D. That''s crazy in my opinion. When you get some 2D games down in Win GDI, then learn the 3D stuff along with the 3D APIs.

DirectDraw was "phased out" with DirectX 8, but you can still use it. I have the DirectX 6.1 SDK installed since I was using the 1st edition of Lamothe''s Tricks volume 1 which had it. I use DirectSound from that SDK which includes a dsutil.cpp | .h making it easy to load sound buffers.

So you want to do some simple 2D games, do them as simply as possible with Win GDI and C/C++. The other route is the do some games with DarkBasic or another basic. That will teach you some concepts which you can transfer to your C/C++ games. Going to Direct3D for Pong or Breakout is crazy in my opinion, unless you mean a 3D Pong.

VazGames.com

Phil P
Thanks PhilVaz for your post.

In my computer I have the DirectX 8.1 SDK and the old DirectX 6.1 documentation.
The problem is that I have compiling problems with the old DirectInput and DirectSound examples from the Tricks book. Big deal! I will just use the 8.1 DirectInput and DirectSound from the RPG book.
So why to stick with the old DirectDraw code and not use the Direct3D interfaces for 2d graphics? (For example D3DXCreateSpite and cd3dfont)

I can easily create pixels with DirectDraw, but I have some problems with the BLT functions and LPDIRECTDRAWCLIPPER.

But I probably follow your advice. I will stick with DirectDraw for some simple 2D games (pong, breakout, Tetris, space invaders etc). If I get stuck I will create the pong clone with GDI in a window. Then I can easily remove the GDI render code and focus at DirectDraw!

And your website is really cool!




#include < Black Liquid Studios >

[edited by - Mephisto on August 19, 2003 3:54:11 PM]
<< But I probably follow your advice. I will stick with DirectDraw for some simple 2D games (pong, breakout, Tetris, space invaders etc). If I get stuck I will create the pong clone with GDI in a window. Then I can easily remove the GDI render code and focus at DirectDraw! And your website is really cool! >>

Thanks, its just a bunch of links with my simple demos. BTW, you can go full screen with Win GDI only, you just make your window "Popup" style and use a DEVMODE struct and call ChangeDisplaySettings( ) at the resolution you want. My Breakout and Asteroids clones both go fullscreen in Win GDI.

I understand DirectDraw is "easier" to set up than Direct3D, and since it works with previous DirectX versions, you can stick with it.

Phil P
Thanks for the Tip!



#include <Black Liquid Studios>



[edited by - Mephisto on August 19, 2003 3:55:34 PM]

This topic is closed to new replies.

Advertisement