Jump to content

  • Log In with Google      Sign In   
  • Create Account

We're offering banner ads on our site from just $5!

1. Details HERE. 2. GDNet+ Subscriptions HERE. 3. Ad upload HERE.


DirectX question


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
13 replies to this topic

#1 bosjoh   Members   -  Reputation: 122

Like
Likes
Like

Posted 07 October 1999 - 08:11 AM

I have programmed a lot in DOS and I want to start programming in windows using DirectX.

Can someone send me a source that demonstrates how to get into 640x480x256 gfx mode and plots a pixel?
That's the best way for me to learn things (look at sources, changing things etc.)


Sponsor:

#2 Facehat   Members   -  Reputation: 696

Like
Likes
Like

Posted 02 October 1999 - 08:17 AM

I really recommend you get a book, since DirectDraw isn't near as easy as just plain DOS IMHO. That said, DirectDraw isn't hard to learn -- its just a bit different .

Anyway, I'll send you the source to my DirectDraw graphics library if you want it. I personally think its pretty nice myself (I use it in all my projects), but theres plenty of room for improvement.

--TheGoop


#3 Facehat   Members   -  Reputation: 696

Like
Likes
Like

Posted 02 October 1999 - 08:19 AM

Oh yeah, one more thing. It only works with 16bit color -- not palletized mode.
--TheGoop

#4 bosjoh   Members   -  Reputation: 122

Like
Likes
Like

Posted 02 October 1999 - 09:07 AM

Thanx for the reply,
but where did you send the sources to?
To bosjoh@fcmail.com? Because I didn't find it there.

#5 Qoy   Members   -  Reputation: 127

Like
Likes
Like

Posted 02 October 1999 - 08:15 PM

Hey. I just wanted to say the "Windows Game Programming for Dummies" is a really good book. It taught me all about game programming in general, and about DirectDraw, DirectSound, and DirectInput.
Good luck,
Qoy

#6 bosjoh   Members   -  Reputation: 122

Like
Likes
Like

Posted 02 October 1999 - 09:21 PM

I've read a tutorial that explains how to use directdraw and has sources. Try to ran those sources and of course: They wouldn't run (ARGH!).
The compiler keeps moaning about: 'unreferenced external symbol _main'.
This only happens when I include 'ddraw.h'.
If I understand it well, I must start my program with WinMain, but that's impossible with main declared (writes to MS-DOS prompt).
When I try to run the source from main I will get a invalid operation error when it tries to create the primary surface. It didn't tried to access 640x480x256 either.

#7 Facehat   Members   -  Reputation: 696

Like
Likes
Like

Posted 03 October 1999 - 04:23 AM

Before I was only asking if you wanted the sources, thats why I didn't send them -- I wasn't sure if you wanted them or not (Do you want them?). If your using VisualC++ you have to create a Win32 Application, not a Win32 console app (I don't know what you have to do with Borland).

In a windows program you should never use main, only WinMain(). Although you can create a window from a console app its not good style -- and from what your saying it doesn't sound like it works all the time.

--TheGoop


#8 bosjoh   Members   -  Reputation: 122

Like
Likes
Like

Posted 03 October 1999 - 06:27 AM

Sorry for the misunderstanding,
of course I want the sources.
And the compiler I use is VC++ 6.0. For some reason you can't write a windows app. I don't know which option I should set that it can use WinMain (and stop bugging me with main).

#9 Machaira   Moderators   -  Reputation: 1028

Like
Likes
Like

Posted 04 October 1999 - 02:51 AM

When you start VC++ click the File | New menu items, make sure the Projects tab is selected on the dialog that comes up and select the Win32 Application project. The Win32 Console Application is what you're probably selecting.

#10 WesLiu76   Members   -  Reputation: 122

Like
Likes
Like

Posted 04 October 1999 - 05:09 AM

Well, if you just want to run your DOS program in a console window, then just create a new WIN32 Console Application project and #include & in your program and it should fire up. I don't know about your proggie being able to request 800x600 8-Bit in a console window though.

And I do agree with an earlier post about getting "Windows Game Programming for Dummies". Don't let the "Dummies" fool ya as Andre Lamothe does quite well in explaining DirectX components DirectDraw,Sound,Input as well as Windows GDI. No Direct3D but he covers that in some of his other books (I think).

Wesley Liu


#11 WesLiu76   Members   -  Reputation: 122

Like
Likes
Like

Posted 04 October 1999 - 05:16 AM

OOps, some of my post got dropped.. should read:

"just create a new WIN32 Console Application project, insert your dos code (using main()), #include windows.h & windowsx.h and it should fire right up."

Wesley Liu

------------------
~~~~~~~~~~~~~~~~~~~~~~~~
Currently Network Engineer but soon to be full-time Game Developer!!


#12 bosjoh   Members   -  Reputation: 122

Like
Likes
Like

Posted 04 October 1999 - 08:15 AM

I think the topic has changed from DirectX question to windows programming question
I have looked everywhere in the options about setting the format. I guess I missed the file->new option.

See if it is there what I want...


#13 bosjoh   Members   -  Reputation: 122

Like
Likes
Like

Posted 05 October 1999 - 06:40 PM

Thanx for all your replies.
I have found the solution to my problem.

I'd better get a book and start windows programming instead of starting DirectX.


#14 bosjoh   Members   -  Reputation: 122

Like
Likes
Like

Posted 07 October 1999 - 08:11 AM

TheGoop: I think your sources aren't needed anymore.
I've finally discovered a way to plot pixels the way I like (using LOCK and retrieving the pointer to the primary surface).




Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS