Some newbie stuff! 
Author Message
 Some newbie stuff!

Hi!

My name is Marcus and I'm a 24 y.o. computer-science student from Sweden.
I hope to one day be able to make some simple games using VB.NET and
DirectX9, and therefore I'd like your opinion on some stuff.

How difficult is it to make simple 2D games in VB.NET & DirectX9? I've tried
VB6 with DirectX7 but not with much success.

Should I try out DirectX9 or should I stick with VB.NET's built-in graphics
capabilities since I "only" want to make simple 2D-games?

I'd appreciate some advice, although my questions might be sort of weird.

/Marcus



Thu, 23 Jun 2005 01:57:25 GMT  
 Some newbie stuff!
DirectX 7 - very good for simple 2D games
DirectX 8 - very good for complex 2D games that want to take advantage of
alpha blending (color effects basically).
DirectX 9 - I know for a fact it still can do the DirectX 8 - style of 2D,
but I heard it was able to do the DirectX 7 - style of 2D, BUT I am not
certain at all.

As for using VB.NET's drawing capabilities.  They are fine, but they aren't
"hardware accelerated".  Which means, the only drawback to using VB.NET's
drawing is that it's MUCH slower than DirectX.

Mike.


Quote:
> Hi!

> My name is Marcus and I'm a 24 y.o. computer-science student from Sweden.
> I hope to one day be able to make some simple games using VB.NET and
> DirectX9, and therefore I'd like your opinion on some stuff.

> How difficult is it to make simple 2D games in VB.NET & DirectX9? I've
tried
> VB6 with DirectX7 but not with much success.

> Should I try out DirectX9 or should I stick with VB.NET's built-in
graphics
> capabilities since I "only" want to make simple 2D-games?

> I'd appreciate some advice, although my questions might be sort of weird.

> /Marcus



Thu, 23 Jun 2005 12:02:12 GMT  
 Some newbie stuff!
Hi Marcus

I don't know if this will help you, but I have had good
success using windows GDI (win32API) with 2D games, but
with VB6. (not VB.NET)

I wrote some classes based on GDI using the bitBlt
function (copying a block of memory to video memory) and
it is very fast. Obviously it does not make use of 2D
hardware acceleration.

When using the standard VB (6) methods such as image.move
(x,y) , you end up with a flicker effect because the form
is repainting before you put the graphic in the new
location. The way to fix this is to create an off-screen
device context (createDC) for your screen and assemble
everything there. Then using bitblt, copy all the updated
areas to the screen in one go.

You can also mask out colors using raster operation codes
and combining them so that you can create images with
tranparent backgrounds. You can even use these operation
codes to create transparency effects etc.

I suggest building a generic sprite class and "canvas"
class and compiling them into a dll. You can then use
inheritence in VB.NET and build a spacehip class for
example which inherits the animation methods from your
sprite class.

If you have MSDN, look up "BITBLT" and see if you can
find some samples.

Hope this helps.

Quote:
>-----Original Message-----
>Hi!

>My name is Marcus and I'm a 24 y.o. computer-science

student from Sweden.
Quote:
>I hope to one day be able to make some simple games
using VB.NET and
>DirectX9, and therefore I'd like your opinion on some
stuff.

>How difficult is it to make simple 2D games in VB.NET &

DirectX9? I've tried
Quote:
>VB6 with DirectX7 but not with much success.

>Should I try out DirectX9 or should I stick with

VB.NET's built-in graphics
Quote:
>capabilities since I "only" want to make simple 2D-games?

>I'd appreciate some advice, although my questions might
be sort of weird.

>/Marcus

>.



Sat, 25 Jun 2005 16:10:42 GMT  
 Some newbie stuff!

Johann has some good ideas for using GDI.
DirectX9 does indeed have the DirectDraw interfaces back (simpler 2D blt'ing
of images). It's the way to go if you want FullScreen apps that may be of
different resolution than windows. It's probably a lot simpler to use GDI's
Blt functions, at least for testing and getting something going quickly.

If you want more advanced features, such as hardware-accelerated sprite
rotations, alpha blending and such (nice features for 2D), then DirectX is
the answer.

Actually, DirectX is more than just the graphics. If your game is going to
be playing wav's and you want 2 or more to play simultaneously, you may want
to use DirectX for the DirectSound functions. This doesn't mean you have to
use Direct3D or DirectDraw, just something to think about.

For now, I would use GDI and concentrate on getting your first, simple game
working. There are a lot of obstacles to overcome when programming a game,
even a simple one, and getting things moving may your best bet. Once you get
into it more, you may even be able to answer "GDI vs. DirectX" yourself :)

-Nerseus


Quote:
> Hi Marcus

> I don't know if this will help you, but I have had good
> success using windows GDI (win32API) with 2D games, but
> with VB6. (not VB.NET)

> I wrote some classes based on GDI using the bitBlt
> function (copying a block of memory to video memory) and
> it is very fast. Obviously it does not make use of 2D
> hardware acceleration.

> When using the standard VB (6) methods such as image.move
> (x,y) , you end up with a flicker effect because the form
> is repainting before you put the graphic in the new
> location. The way to fix this is to create an off-screen
> device context (createDC) for your screen and assemble
> everything there. Then using bitblt, copy all the updated
> areas to the screen in one go.

> You can also mask out colors using raster operation codes
> and combining them so that you can create images with
> tranparent backgrounds. You can even use these operation
> codes to create transparency effects etc.

> I suggest building a generic sprite class and "canvas"
> class and compiling them into a dll. You can then use
> inheritence in VB.NET and build a spacehip class for
> example which inherits the animation methods from your
> sprite class.

> If you have MSDN, look up "BITBLT" and see if you can
> find some samples.

> Hope this helps.

> >-----Original Message-----
> >Hi!

> >My name is Marcus and I'm a 24 y.o. computer-science
> student from Sweden.
> >I hope to one day be able to make some simple games
> using VB.NET and
> >DirectX9, and therefore I'd like your opinion on some
> stuff.

> >How difficult is it to make simple 2D games in VB.NET &
> DirectX9? I've tried
> >VB6 with DirectX7 but not with much success.

> >Should I try out DirectX9 or should I stick with
> VB.NET's built-in graphics
> >capabilities since I "only" want to make simple 2D-games?

> >I'd appreciate some advice, although my questions might
> be sort of weird.

> >/Marcus

> >.



Sun, 26 Jun 2005 05:37:44 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. 3 expert questions about newbie stuff

2. Basic Newbie Stuff - sorry

3. String comparision ... newbie stuff

4. Newbie stuff

5. Help a newbie: All this stuff is overwhelming

6. Newbie binary file stuff

7. Newbie string stuff

8. Newbie Help: Sorting stuff

9. Newbie to Classes and stuff

10. ***NEWBIE ALERT***NEWBIE ALERT***NEWBIE ALERT***

11. Good Stuff on Recordsets/DAO etc

12. WIERD STUFF PLZ HELP

 

 
Powered by phpBB® Forum Software