Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

DrMol

API or not?

This topic is 5931 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

In my current project, I am going to rely somewhat heavily on windows and all their little pet controls. I was wondering, for those who use the Win API, as opposed to those who have lots of time on their hands (of which I am part of) who coded their own window classes: Which should I do? The game will be heavily GUIed but it is not a fast paced game, almost closer to an application in terms of activity. However, as I said above, I have lots of time on my hands and no set date for the project''s completion as it is a personal thing. So what do you all recommend? Use the Windows stuff or make my own? Or should I post more information? Thanks a lot.

Share this post


Link to post
Share on other sites
Advertisement
Are you asking whether or not you should use MFC vs. making calls directly to the Win32 API? If that''s your question, I think it''s more a combination or personal choice, deadline requirements of the project (which you say are basically none), and the type of program you''re building. Since you say that the what you''re building would be closer to an "application" (I assume you mean something like Word or Excel) in terms of performance requirements, then MFC could be very helpful to you. Calling directly to the Win32 API is more time-consuming, but possibly yields better performance and is also more of an educational journey through low-level Windows (if you''re into that sort of thing).

If you''re asking whether or not you should use the Win32 API...Well, I''m no expert on all things Windows, but I don''t think you can program a Windows app without using that Win32 API (unless you plan to use Assembler).

Share this post


Link to post
Share on other sites
I think it depends on the type of game you''re making. MFC is a thin wrapper of the Win32 API common controls, so it make sense to use it unless you''re an advanced programmer and making custom controls.

Also, you can use MFC and still blend in your own graphics functionality, i.e. make shapes, manipulate colors etc. in say a derivation of the CView class, using the Windows GDI (I think that''s what it is called). However it''s definitely not the optimum way to implement high-framerate graphics updates.

I think some example MFC programs in certain books show how you can use the GDI to make simple sketch and paint programs. That might be a good place to start.

Share this post


Link to post
Share on other sites
NO! Not MFC, Ive had enough trouble dealing with MFC. What I mean is say I want a button, do I do

CreateWindow( BUTTON, ... )
after doing CreateWindow( blahblah )

or would it be better to make a completly independant windows system, something along the lines of the "Programming a GUI Using DirectX" article in the Gamedev archives, which barely touches on the API.

What I mean by application is yes Excel, Word, etc, but in the sence which I am using it, I am trying to say that my game is not a fast paced reaction clicker, more of a read, contemplate, act type.

I appreciate input, maybe it would be better if there are some pros or cons for each approach-this is IMO the most sensitive part of the project. If I realise later on that the way I went is giving me performance hits, then it will probably be pretty tough to change the setup.

Just to further clarify things,
what I am saying is is it better to create a window using
the CreateWindow( ... ) function or to do

class DRMOLS_WINDOW_CLASS
{
//Redrawing code
//Creation Code
//Coordinates
//BackGround
}

Thanks again.

Share this post


Link to post
Share on other sites
I''d suggest that you learn MFC. It''s not that hard to use (and it''s a hell of a lot easier than straight Win32). Plus it''s very easy to write custom controls. You could write your own GUI code, but what''s the point? Windows has been in use for years and it''s GUI code is relatively bug-free, so why re-invent the wheel (unless you''re in a DirectX or opengl environment and don''t have much choice)

You can probably find other people''s custom GUIs out there. I know there''s plenty which work for either DirectX or opengl, so why not for GDI?


codeka.com - Just click it.

Share this post


Link to post
Share on other sites
I would recommend using the Windows API. Everything is already there for you and unless you are a good artist, it is hard to make a homemade GUI look good.

---
Make it work.
Make it fast.

"Commmmpuuuuterrrr.." --Scotty Star Trek IV:The Voyage Home

Share this post


Link to post
Share on other sites
Thanks for the input! I have decided. For now, I am going to use winAPI but encapsulate it as much as possible, at the expense of speed. Later on when I have the core game up and running, I will go back and create my own interface, for both the educational experience and the enjoyment of it, and hopefully, the windows code will be seperate enough for me to be able to plug in my homemade stuff later on.

Share this post


Link to post
Share on other sites
Just a suggestion, but have you looked at Microsoft''s WTL? It''s kind of a mix between MFC and the API.

Share this post


Link to post
Share on other sites
I just wanted to point out that everyone who responded to this post other than CaptainJester and myself need to learn to READ. Not a single other person managed to come even close to answering his question or even understanding it hehe. As for my opinion...

I think that making your own objects would be a very tedious task but as long as you are doing it for your own personnal satisfaction and education, I think its a very good idea. Definately something worth the effort just to be able to say you did it, did it right, and made it look good!

~Vendayan

[edited by - Vendayan on June 26, 2002 10:36:03 PM]

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!