Reputation: 607
so this is pretty much what I wanna do... I recently start using sublime text 2 as my new number 1 editor. I also want to start programming directX and I was wondering if there is way to use sublime text2 instead of Visual Studio.
I was thinking of something like...
...programming in Sublime Text2 ...compiling/building within Sublime Text2 ...debugging from Visual Studio? or maybe WinDbg? never used it
I know that I could just have a normal VisalStudio project setup and just writing the code with ST2 but then it I will have problems when I want to add new files in sublime text etc.. I always have to keep the visual studio filter and project file up to date...
I need some kind of workflow which make sense :) I am also wondering if there are not more people out there which don't like Visual Studio that much or have limited resources on their machines like me. It can not be that all DirectX Programmers are using Visual Studio?
Upvotes: 3
Views: 2289
Reputation: 23550
The question was asked this a long time ago, but maybe this answer will help someone, here's what I do:
In this scenario it is best to leave Visual Studio closed completely. You can just use a makefile to build your project. You can run the makefile and executable from Sublime Text directly.
Project >> Add Folder to Project
Tools >> Build System >> Make
main.exe: main.o g++ -o main.exe *.o -lkernel32 -luser32 main.exe main.o: main.cpp g++ -c main.cpp -o main.o
(Note: this only links kernel32 and user32, for DirectX you need some more stuff, if you dont know what then copy them from VisualStudio.)
This makefile also automatically runs the executable. You could also replace the line main.exe
with gdb main.exe
to use the debugger that is available on most systems (on windows you would have to install it).
Upvotes: 0
Reputation: 1834
You can attach to a running process with Visual Studio or WinDBG. You can also open any .EXE as a project in Visual Studio or in WinDBG to allow you to start the process under the debugger. So that part of your work flow shouldn't be an issue.
That said the part of your workflow that appears difficult is the compiling/building part. After reviewing Sublime Text 2's documentation for build systems http://sublimetext.info/docs/en/reference/build_systems.html it does not appear that is really trying to provide support for the complexity of compiling multiple C++ source files into object files and then linking those together with the necessary libs. It does seem feasible to create a ST2 build system that will compile and link one C++ source file in to an EXE, but that may not be sufficient for your needs.
https://github.com/tillig/SublimeMSBuild may be your best bet as it both provides support for editing msbuild files in ST2 and and actually building them. That said it does not appear that will automatically generate or update msbuild project files from C++ files in ST2 so you would still have to keep the msbuild project file up-to-date, but the task could be done in ST2 rather than in VS.
Upvotes: 3