Thread: Notepad++ Game Programming -- Working with Directx and Win32 Programming.

  1. #1
    Registered User
    Join Date
    Dec 2011
    Posts
    4

    Lightbulb Notepad++ Game Programming -- Working with Directx and Win32 Programming.

    I have written Win32 programs Notepad, and compiled each program with MinGW. Success!!!! However, I, now, want to use directx. How do I setup a C/C++ project in Notepad++, as well as link the directx dll's and libs to this project. Coding this way, I don't have makefile capabilities, and the ability to include the "dependencies" needed to execute/utilize directx within my Win32 application.

    Can any of the C/C++, Win32, MinGW, or Notepad++ guru's assist me with my issue.

    P.S.
    By the way, I don't want to use IDE's. I feel like I can learn more by doing most programming in text editors. Please help me to accomplish this.

  2. #2
    Registered /usr
    Join Date
    Aug 2001
    Location
    Newport, South Wales, UK
    Posts
    1,273
    I'm not sure that you can actually "set up" Notepad++, given that it's... well... a simple text editor. It sounds like trying to specify where your Photoshop effects folder is in MS Paint.

    I stopped using the Visual Studio IDE a while back as it takes too long to load and work in for my needs, but I still use the MSVC compiler. I write code in a simple text editor (Notepad2 in my case) and then use a batch file to call the compiler, with all the relevant options on the command line.

    So a batch file would be one solution for you.

  3. #3
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    39,660
    > Coding this way, I don't have makefile capabilities
    MinGW comes with make.
    So all you need to do is setup a makefile, and configure your editor to run "make" whenever you press the assigned function key (or whatever).

    First, a small batch to setup the MinGW environment, and run make
    Code:
    cd "C:\Users\sc\Documents\Projects\forum"
    call "C:\Program Files\CodeBlocks\MinGW\mingwvars.bat"
    mingw32-make -f foomake.txt 1>make_1.log 2>make_2.log
    pause
    Put it in your project top-level and give it a name like maker.bat

    Now create a makefile (change the -f filename above if you want)
    Code:
    CC=mingw32-gcc.exe
    OBJECTS=foo.o
    prog.exe: $(OBJECTS)
    	$(CC) -o $@ $^
    To build in NP++, just press F5 and navigate to the batch file.
    The output and errors will be in the respective log files.

    If NP++ were a bit smarter, it would be able to parse error logs and take you to the respective file/line.
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.

  4. #4
    Registered User
    Join Date
    Dec 2011
    Posts
    4

    Linking Directx to Win32 program within Notepad++

    Quote Originally Posted by Salem View Post
    > Coding this way, I don't have makefile capabilities
    MinGW comes with make.
    So all you need to do is setup a makefile, and configure your editor to run "make" whenever you press the assigned function key (or whatever).

    First, a small batch to setup the MinGW environment, and run make
    Code:
    cd "C:\Users\sc\Documents\Projects\forum"
    call "C:\Program Files\CodeBlocks\MinGW\mingwvars.bat"
    mingw32-make -f foomake.txt 1>make_1.log 2>make_2.log
    pause
    Put it in your project top-level and give it a name like maker.bat

    Now create a makefile (change the -f filename above if you want)
    Code:
    CC=mingw32-gcc.exe
    OBJECTS=foo.o
    prog.exe: $(OBJECTS)
        $(CC) -o $@ $^
    To build in NP++, just press F5 and navigate to the batch file.
    The output and errors will be in the respective log files.

    If NP++ were a bit smarter, it would be able to parse error logs and take you to the respective file/line.

    I thank you for your assistance. I will definitely keep that in mind. My issue is this. Normally, in Visual Studio's IDE, when one creates a directx and win32 project, certain processes have to take place. First, one has to set a path to the dependencies of the program, or in better words, a path to the directx SDK stuff, in this case, the directx libraries and directx includes, both of which contain the dll's, etc. In Visual Studio's, there is a user-friendly way of accomplishing this. In Visual Studio's, one would merely right-click project, and under Configuration Properties, click VC++ Directories, next click Library Directories or Include Directories, respectively, and browse for the Libs and Includes that the currect program/project will depend on. In this case, it's my Win32 project featuring the directx stuff. In Notepad++, I don't have to include a path to Win32 API because I guess it comes default with all Windows Operating system. This is great because I don't have to specify a path to Win32 stuff nor install a Win32 API. This, of course, is not the case with Directx. You have to download the SDK and link your project to it. I'm not using an IDE to easily do this, I'm using Notepad++. My question (specifically) is how can I accomplish creating a Win32, C++, project on my system, and link Directx Includes and Libraries to my project?? I don't understand how this works. Help!!!!!!!!!!

    Thanks Smurf and Salem for the replies so far.

  5. #5
    Registered User
    Join Date
    Dec 2011
    Posts
    4
    I think I have a solution. With MinGW, there is a way to program with Directx. I can actually run a program that can convert Directx to a dot.a file. The I can use MinGW to reference the directory where the directx dll and libs are located. Thanks for the help guys.

    Example MinGW: g++ main.cpp -o test.exe -I ../dxsdk/include ../dxsdk/lib/dxguid.lib

    Unless someone can think of a better way to do this.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Win32/2D DirectX Game Programming Books?
    By Darklighter in forum Game Programming
    Replies: 31
    Last Post: 09-19-2006, 09:40 PM
  2. new book about game programming using DirectX
    By Carlos in forum Game Programming
    Replies: 0
    Last Post: 09-20-2005, 08:30 AM
  3. Wanna learn DirectX game programming
    By Hermitsky in forum Game Programming
    Replies: 2
    Last Post: 12-01-2004, 07:35 AM
  4. i want to get into directx game programming
    By stallion in forum Game Programming
    Replies: 12
    Last Post: 02-19-2003, 04:29 PM
  5. Win32 game programming
    By Garfield in forum Game Programming
    Replies: 16
    Last Post: 11-14-2001, 08:25 PM

Tags for this Thread