[QUOTE=~ZOMG;36649846]What would you guys recommend as a good IDE for a beginner learning C++?[/QUOTE]
Assuming you're on Windows, then Visual C++ Express. It's free, but if you can somehow get Visual Studio for free (if you're a student, for example), then I'd recommend that instead.
[QUOTE=Chris220;36649905]Assuming you're on Windows, then Visual C++ Express. It's free, but if you can somehow get Visual Studio for free (if you're a student, for example), then I'd recommend that instead.[/QUOTE]
Great, thanks. Although I'm a student, my school isn't listed so I'll stick Visual C++.
[editline]6th July 2012[/editline]
This strikes me as a very simple problem, but I have no idea how to fix it regardless.
[code]
1>------ Build started: Project: Sample, Configuration: Debug Win32 ------
1> Sample.cpp
1>Sample.cpp(3): warning C4627: '#include <iostream>': skipped when looking for precompiled header use
1> Add directive to 'StdAfx.h' or rebuild precompiled header
1>Sample.cpp(11): fatal error C1010: unexpected end of file while looking for precompiled header. Did you forget to add '#include "StdAfx.h"' to your source?
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
[/code]
It's literally the first little program my book teaches. I remember having problems getting everything with my IDE setup before when I tried learning C++.
[code]
#include <iostream>
using namespace std;
int main()
{
cout << "C++ is power programming - whatever the fuck that means...";
return 0;
}
[/code]
[QUOTE=~ZOMG;36650011]Great, thanks. Although I'm a student, my school isn't listed so I'll stick Visual C++.
[editline]6th July 2012[/editline]
This strikes me as a very simple problem, but I have no idea how to fix it regardless.
[code]
1>------ Build started: Project: Sample, Configuration: Debug Win32 ------
1> Sample.cpp
1>Sample.cpp(3): warning C4627: '#include <iostream>': skipped when looking for precompiled header use
1> Add directive to 'StdAfx.h' or rebuild precompiled header
1>Sample.cpp(11): fatal error C1010: unexpected end of file while looking for precompiled header. Did you forget to add '#include "StdAfx.h"' to your source?
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
[/code]
It's literally the first little program my book teaches. I remember having problems getting everything with my IDE setup before when I tried learning C++.
[code]
#include <iostream>
using namespace std;
int main()
{
cout << "C++ is power programming - whatever the fuck that means...";
return 0;
}
[/code][/QUOTE]
Looks like it's trying to use a precompiled header called 'StdAfx.h'. To fix this, I'd recommend just starting with an empty project in VS. So, on the 'New Project' window, you select Win32 Console Application, then when it asks you for the various options for creating the project, you want to make sure you select 'Empty Project'.
Okay, I before I started a new project as a CLR Console Application.
[editline]6th July 2012[/editline]
Tried it again, got this:
[code]
1>------ Build started: Project: Sample2, Configuration: Debug Win32 ------
1> Sample2.cpp
1>c:\users\aidan\documents\visual studio 2010\projects\sample2\sample2\sample2.cpp(5): warning C4627: '#include <iostream>': skipped when looking for precompiled header use
1> Add directive to 'StdAfx.h' or rebuild precompiled header
1>c:\users\aidan\documents\visual studio 2010\projects\sample2\sample2\sample2.cpp(15): fatal error C1010: unexpected end of file while looking for precompiled header. Did you forget to add '#include "StdAfx.h"' to your source?
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
[/code]
[editline]6th July 2012[/editline]
It did how ever work with the addition of
[code]
#include "StdAfx.h"
[/code]
[editline]6th July 2012[/editline]
I feel so dumb.
You want Win32 Console Application, not CLR.
That's what I'm using.
<snip>
Oh, I misread what you said. My apologies!
The reason it's asking for StdAfx.h is because you haven't created a blank, empty project.
[QUOTE=Chris220;36651007]Looks like it's trying to use a precompiled header called 'StdAfx.h'. To fix this, I'd recommend just starting with an empty project in VS. So, on the 'New Project' window, you select Win32 Console Application, then when it asks you for the various options for creating the project, you want to make sure you select 'Empty Project'.[/QUOTE]
This, so much. If not just to fix the problem, then at least for the sake of portability. I'm suprised how many people develop stuff in ways more difficult than just following standards, and maybe touching a cross-platform library such as Boost, instead of wasting hours learning Windows-only methods.
What is the way to have a game loop in Android development? Would I create a new thread and have it execute based on the data I send it from things like motion events?
[QUOTE=WTF Nuke;36652686]What is the way to have a game loop in Android development? Would I create a new thread and have it execute based on the data I send it from things like motion events?[/QUOTE]
Use [url=http://developer.android.com/reference/android/opengl/GLSurfaceView.html]GLSurfaceView[/url] and it'll spin off a new thread for you with a drawing loop. Motion events are a bit more complicated as you have to deal with threading to send the motion event from the activity thread to the GL thread.
I've got an Android game that I'm open sourcing very soon and you can take a look at how we set up motion events, or you can take a peek at the much better designed AndEngine. (or just use AndEngine...)
-snip-
I thought the GLSurfaceView was just for drawing, and the logic be handled elsewhere? And I mean, there is no loop in Android development like there is in C++ a main function, so yeah.
[QUOTE=WTF Nuke;36653788]I thought the GLSurfaceView was just for drawing, and the logic be handled elsewhere? And I mean, there is no loop in Android development like there is in C++ a main function, so yeah.[/QUOTE]
Yeah, you can structure it that way by spinning off another logic thread, but I find it's simpler to start with everything happening on the same thread since it takes a lot of time to build a cross-thread communication system that preforms better than a single thread. Especially when both threads are sharing all the game's entities, and especially when it's possible to add or remove entities from the world.
[QUOTE=Chris220;36652334]<snip>
Oh, I misread what you said. My apologies!
The reason it's asking for StdAfx.h is because you haven't created a blank, empty project.[/QUOTE]
I really am sorry for being such a nuisance, but how do I do that? I'm currently going File > New > Project... and selecting a Win32 Console Application. Is that wrong?
Ah ok, cheers mate.
[QUOTE=~ZOMG;36654695]I really am sorry for being such a nuisance, but how do I do that? I'm currently going File > New > Project... and selecting a Win32 Console Application. Is that wrong?[/QUOTE]
No, that's fine. After you've done that, do this:
[img]http://i.imgur.com/qWOMV.png[/img]
Even more importantly, uncheck "Precompiled header", which happens to be exactly what's causing his issue.
It compiles! Thank you so much guys, I really am sorry for being so ignorant about the whole thing; your help is much appreciated.
[QUOTE=raBBish;36654904]Even more importantly, uncheck "Precompiled header", which happens to be exactly what's causing his issue.[/QUOTE]
[i]Empty project[/i] implies no precompiled headers, so he doesn't have to untick that manually.
[QUOTE=raBBish;36654904]Even more importantly, uncheck "Precompiled header", which happens to be exactly what's causing his issue.[/QUOTE]
Checking Empty Project will automatically disable the Precompile Header option!
[editline]7th July 2012[/editline]
Dammit overv.
[QUOTE=~ZOMG;36649846]What would you guys recommend as a good IDE for a beginner learning C++?[/QUOTE]
This advice may be controversial, but I think as a beginner you shouldn't use an IDE.
Learn to compile and link yourself. Learn about what object files are, the difference between source and header files, and how your program is actually built.
An IDE might be a great idea for a programmer who knows what they're doing and are comfortable with the whole process. For a beginner though, using an IDE will just hide details from you and you'll not have a total idea about what happens when you press the run button.
How do I use an atlas texture with OpenGL? Would it be with the coordinate data? If so, is there an easy way to edit it and offset it on the fly (like matrix operations but with the 2 coordinate triangles)?
Does anyone have a good reference for Game Programming? Whenever I search for it I mostly get things about rendering, which is interesting but not what I am looking for right now.
What I mean is things like entities, update handling, level handling, menus things like that. It's always something I get stuck upon, and I have no Idea how to get around them. If someone could hint me into the right direction that would be awesome.
[QUOTE=WTF Nuke;36658380]How do I use an atlas texture with OpenGL? Would it be with the coordinate data? If so, is there an easy way to edit it and offset it on the fly (like matrix operations but with the 2 coordinate triangles)?[/QUOTE]
Yeah, you can just have a [i]uniform mat3 texMatrix;[/i] in your fragment shader and multiply it with the texture coordinates. It was called a texture matrix in older versions of OpenGL, but now you can just implement it yourself.
[QUOTE=commander204;36660924]Does anyone have a good reference for Game Programming? Whenever I search for it I mostly get things about rendering, which is interesting but not what I am looking for right now.
What I mean is things like entities, update handling, level handling, menus things like that. It's always something I get stuck upon, and I have no Idea how to get around them. If someone could hint me into the right direction that would be awesome.[/QUOTE]
I hit that point too, where engine organization and implementation became more important than just coding "straight to the point".
I advise you study other people's engines and how they work. Kopini studied the Irrlicht engine and created a engine skeleton from it. He's added to it since then so it's a little more complicated than a skeleton now, you can look at it here:
[url]https://github.com/kopimi/kopengi/tree/master/src[/url]
I copied his engine skeleton and built heavily upon it; it became a highly functional engine with a proper state machine, level handling, entity handling, and update handling like you've asked. You can look at it here:
[url]https://github.com/naelstrof/Astrostruct/tree/master/src[/url]
While there's lots of documentation on how it works here:
[url]http://farmpolice.com/astrostruct/[/url]
Have fun and good luck, and remember you can add me on steam or shoot me some pm's if you have some questions.
I need to build a soundboard type windows application; that supports single channel output as per users settings. My biggest hurdle seemingly would be the GUI.
I want it to be similar to this: [url]http://www.blackcatsystems.com/software/soundbyte.html[/url]
I've only ever used Visual Studio for ASP.NET C#; I was looking into WindowsForms; is this a good start? Any pointers / examples I can run off of to develop with visual studio for this? Anyone know how I can use bass.dll with this? Thanks! :)
I've just finished my first program in c++, It uses arrays, recursion, checking for bad input, all that good stuff.
However, i was wondering 2 things; What would be a good book that preferably goes from the ground up for c++? I think i used to have an Ebook called "the definitive guide to c++", but i'm not sure. Also, what would you guys suggest as a second project?
Is there a way to compile and run a program from MS Visual C++?
Sorry, you need to Log In to post a reply to this thread.