Thread: What Language to learn???

  1. #1
    Registered User
    Join Date
    Jun 2004
    Posts
    3

    What Language to learn???

    Hey Everyone,

    I really want to start learning some real Programming languages (not just qbasic ..lol). I need to create a Program that is Visually Entertaining (kinda Like PLayOnline's Interfaced) w/ button animations, sounds, visual effects, transitions and such. But it also has to interface w/ an ECM (electronic Controll Module for a car) and GPS Software. and also have it controll an external relay board, and also a Media Player (DVD, VCD, Divx, AVI, MOV, MP3, WMA, etc etc).

    Wanted to get some suggestion on what to start reading up on. I'm Thinking DirectX would be great concidering i MIGHT even do some 3d stuff (i know CAD and Lightwave) to make it look better, PLus the ECM software can create 3d graphical layouts of Fuel Ratio's and hp and such. So kinda like Xbox's 'DashBoard'.

    Anywho, Thanks for any suggestions!!

  2. #2
    vae victus! skorman00's Avatar
    Join Date
    Nov 2003
    Posts
    594
    First off, many people get this point confused, so let me say it once again

    DirectX is not a programming language

    Any language can do what you propose. The only obstacle is your own ability. Since you consider DirectX a programming language, I suggest you start small.

    A menu system like PlayOnline's seems easy at first, but when you sit down and program something like that, you realize that it's pretty complicated. I'll be glad to give you some insight on specific problems that come up.

  3. #3
    Registered User
    Join Date
    Jun 2004
    Posts
    3
    Yea, I knew directx isn't it's own language, it's more like an extension to C++ right? lol. Yea, i'm fairly -green- in heavy programming and im not expecting to breez through this, but i'm hoping to find some templates and such i can modify to make things go by faster.

    PS- So plain old C++ using directX isn't a bad way to go?

    Also, Would it be hard to create a simple player for MP3's and such? or can i use a WMP base and use it in the program?

  4. #4
    The Defective GRAPE Lurker's Avatar
    Join Date
    Feb 2003
    Posts
    949
    There is much, much more to game programming and DirectX than you would think. Get some books, and do plenty of research.

    Also, try looking at gamedev.net and gametutorials.com
    Do not make direct eye contact with me.

  5. #5
    l'Anziano DavidP's Avatar
    Join Date
    Aug 2001
    Location
    Plano, Texas, United States
    Posts
    2,743
    well it doesnt look like he is asking for help with game programming, but rather with help building a graphical interface and he also wants it to interface with other electronic equipment.

    C++ with DirectX is definitely a good way to go, and I am sure many people before you have taken that route and had very successful results. C and C++ are some of the most powerful languages out there.

    You say you know CAD and Lightwave. By the sound of your first post it seems as if you are more of a graphical designer or artist. In that case I also suggest C#. It is a good language, and I believe it can also fully use DirectX. Since you said you dont want to heavily get into the programming of it, but would rather use some sort of template to make it easier, I think C# would be ideal for you. C# makes the graphical interface programming incredibly easy compared to C++ (which is more powerful than C# but a little more complicated).
    My Website

    "Circular logic is good because it is."

  6. #6
    Registered User
    Join Date
    Jun 2004
    Posts
    3
    sweet, Thanks guys, I'll Probably pick up some books tomarrow.

  7. #7
    Registered User Draco's Avatar
    Join Date
    Apr 2002
    Posts
    463
    Since it sounds like you're mostly interested in graphics I would recommend you also give OpenGL at least a once over. It's smaller, faster, and many people say easier to learn than DirectX. I've just started learning it off of http://nehe.gamedev.net 's tutorials, and it isnt hard at all so far.

  8. #8
    Registered User VirtualAce's Avatar
    Join Date
    Aug 2001
    Posts
    9,607
    It's smaller, faster, and many people say easier to learn than DirectX. I've just started learning it off of http://nehe.gamedev.net 's tutorials, and it isnt hard at all so far.
    I beg to differ on the faster part. I'm not sure that any one API is faster than the other. Actually it is quite an arrogant assumption because the HAL is written by the video card manufacturer not Microsoft. So if it is slower than OpenGL it is because the manufacturer of the driver and/or HAL goofed and has nothing to do with COM or the DirectX framework. Microsoft lays down the standard and the video card manufacturer writes the actual card-specfic code to interface with the hardware.

    So to say OpenGL is faster is to assume that DirectX is doing most of the work when in fact it is not, the HAL is. Direct3D and DirectX in general will be the only API in the future simply because it supports so much more than just a graphics API. DirectX is a complete video game programming platform that supports just about everything made for a PC or ever going to be made. As long as Microsoft has the OS market, DirectX will be the prime choice for game companies to develop with. And since DirectX is also supported on the XBox (or a derivative thereof...close enough though) then DirectX is simply here to stay. Do yourself a favor and learn it well. IMO OpenGL is extremely limited simply because it only supports graphics and only operates correctly on cards that natively support it. I think that 3rd party graphic APIs are on the way out....as well as 3rd party sound APIs like Creative's EAX unified. Eventually it will all come down to the card level or hardware level and DirectX will be the way to interface with it.

    My advice is to learn DirectX. Do not listen to the people who say it is hard or impossible to learn. COM is a fundamentally brilliant concept and it is NOT that difficult to understand. If you understand pointers and objects then you can use it. You only need a very limited amount of knowledge of COM to use DirectX - very limited. No aggregated COM here - just the basics. DirectX is a huge toolbox sitting out there. Open one drawer of the toolbox and it might expose several other drawers of tools or simply several other tools. That's it. Simple and brilliant.

    Go over to www.gamedev.net and look at their books and resources section. Purchase to your heart's content and you won't regret it.

    You decide for yourself whether you want to learn OpenGL or DirectX. With DX once you learn graphics....sound, networking, input, etc., all follow the same basic setup and shutdown steps. Very simple.

    Here is a sample of one way to get DirectInput up and running. The second example is for the mouse. After you write this code...you simply check for state changes and thats it. Total mouse support for every single mouse that can be connected to an x86 machine running any version of Windows 98/XP/2000.

    CDInput.h
    Code:
    #ifndef CDINPUT
    #define CDINPUT
    #define DIRECTINPUT_VERSION 0x0800
    #include <dinput.h>
     
    
    class CDInput
    {
    	protected:
    		IDirectInput8 *_pDI8;
    	public:
    		CDInput() {};
    		~CDInput() {_pDI8->Release();};
    		HRESULT Init(HINSTANCE hinst);
    };
    #endif
    CMouse.h
    Code:
    #include "CDInput.h"
    
    #define LMB		 0
    #define RMB		 1
    #define MMB		 2
     
    class CMouse:virtual public CDInput
    {
    	protected:
    		IDirectInputDevice8	 *_pDID8;
    	public:
    		CMouse() {};
    		~CMouse() {if (_pDID8) _pDID8->Unacquire();
    		if (_pDID8) _pDID8->Release();};
    		
    		HRESULT Create(HWND window);
    		//Share our data with the world
    		DIMOUSESTATE			_mousestate;
    		HRESULT Update(void);
    };
    CMouse.cpp
    Code:
    #include "CMouse.h"
     
    HRESULT CMouse::Create(HWND window)
    {
    	if (FAILED(_pDI8->CreateDevice(GUID_SysMouse,&_pDID8,NULL)))
    	{
    		::MessageBox(0,"Failed to create mouse device",0,0);
    	}
    	if (FAILED(_pDID8->SetCooperativeLevel(window,
    										   DISCL_BACKGROUND | DISCL_NONEXCLUSIVE)))
    	{
    		::MessageBox(0,"Failed to set mouse cooperative level",0,0);
    	}
    	if (FAILED(_pDID8->SetDataFormat(&c_dfDIMouse)))
    	{
    		::MessageBox(0,"Failed to set mouse data format",0,0);
    	}
    	if (FAILED(_pDID8->Acquire()))
    	{
    		::MessageBox(0,"Failed to acquire mouse",0,0);
    	}
    	//::ShowCursor(false);
    	return true;
    }
    
    HRESULT CMouse::Update(void)
    {
    	
    	if (FAILED(_pDID8->GetDeviceState(sizeof(DIMOUSESTATE),(LPVOID)&_mousestate)))
    	{
    		return FALSE;
    	}   else return true;
    }
    Done. Total mouse support.
    Last edited by VirtualAce; 06-10-2004 at 09:15 PM.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Which language to start with
    By slats in forum A Brief History of Cprogramming.com
    Replies: 51
    Last Post: 05-16-2008, 06:32 AM
  2. Language for text.
    By virgoman57 in forum C Programming
    Replies: 3
    Last Post: 05-12-2008, 02:31 AM
  3. Strange loop
    By D@rk_force in forum C++ Programming
    Replies: 22
    Last Post: 12-18-2004, 02:40 PM
  4. Language Script..
    By vasanth in forum A Brief History of Cprogramming.com
    Replies: 12
    Last Post: 03-30-2003, 06:48 AM
  5. Good site to learn about Prog. language concept?
    By Extrovert in forum Tech Board
    Replies: 5
    Last Post: 03-13-2003, 02:46 AM