There's also C#. I'm not sure, but i think C# is Windows only, so if cross-platform is an issue, you may want to use Python.
Edit: According to http://www.mono-project.com/Main_Page, it's also possible to use C# in Linux & Mac.
Male
__SKYe hasn't added any contacts yet.
Posted by __SKYe
on 01 May 2013 - 12:18 PM
There's also C#. I'm not sure, but i think C# is Windows only, so if cross-platform is an issue, you may want to use Python.
Edit: According to http://www.mono-project.com/Main_Page, it's also possible to use C# in Linux & Mac.
Posted by __SKYe
on 01 May 2013 - 11:34 AM
Do you set the color to white when you render the rest of the textures?
If you don't have a
glColor3f(1.0f 1.0f, 1.0f);
before you draw the textured quads, then any color you've used for something else will also affect the next draws.
Also, since in your example you use the same color for every vertex, you can do this:
//Render the window fill glColor3ub( 0, 17, 34 ); glBegin( GL_QUADS ); glVertex2f( 0.f, 0.f ); glVertex2f( box.w - ( ThemeTemplate->quadWidth * 2 ), 0.f ); glVertex2f( box.w - ( ThemeTemplate->quadWidth * 2 ), box.h - ( ThemeTemplate->quadHeight * 2 ) ); glVertex2f( 0.f, box.h - ( ThemeTemplate->quadHeight * 2 ) ); glEnd();
There's no need to repeat the glColor* every vertex.
Posted by __SKYe
on 19 April 2013 - 04:39 PM
If you include Foo.h in another file, then that other file will also include any files included in Foo.h.
I don't know if there's a proper way or not, but the only thing i can tell you, is that you don't need to include them again. I think it goes a little into the field of coding style.
Posted by __SKYe
on 19 April 2013 - 04:09 PM
Pretty much like FLeBlanc said, an entity is anything that may exist in a game world, be it the player character, a projectile, a trigger (as in event trigger, not a gun trigger), etc.
One thing to note is that normally when we hear game world one usually thinks about the visible things (geometry), but an entity isn't necessarily something that needs to be rendered (although there may be people who only call entities to the things that need to be rendered).
Posted by __SKYe
on 14 April 2013 - 05:19 AM
Yes, you can go tohttp://www.microsoft.com/en-us/download/details.aspx?id=8109, and download the DirectX End-User Runtimes (current version is June 2010), or just go to http://www.microsoft.com/en-us/download/details.aspx?id=35 and download the DirectX End-User Runtime Web Installer.
The difference is that the Web installer is just a small program (~286KB) that will download and install the DX runtimes, while the first link downloads the runtimes ready to be installed (~95MB).
Then you can distribute these files along with your program.
But if the person that will use your program as any recent game installed in it's computer (or had), then chances are, they will already have DIrectX installed.
Perhaps, as to not make the size of the files you have to distribute large (if your only making a small game/application), then you could just include along the Web installer, and if the user doesn't have DirectX runtimes installed, then they can download them.
Posted by __SKYe
on 14 April 2013 - 04:54 AM
You don't need any paid version of Visual Studio to create a release build, any version can create one.
Compared to the Debug build, a Release build executable is stripped of any debug code (used in the libraries, like CRT, not code written by you), and optimizations are turned on, among other things. Also, in a Release build, variables are not initialized to a default value (in Debug mode, in VC++2010 Express, they are initialized to 0xCDCDCDCD, in the case of ints).
Normally you distribute the Release build, along with the necessary DLLs for the program to run.
These DLLs may or may not exist, depending on which libraries you use in your project (for example, if you use Freetype, then you'd have to distribute the Freetype DLL along with your program).
To check which DLLs you need to distribute, you could put your application in another computer, run it, and check which DLLs are reported missing (those are the ones you should include).
If you use DirectX (which in this case you do), then the person that will use your application will need to have DirectX installed in his computer.
Posted by __SKYe
on 14 April 2013 - 04:30 AM
In the function
bool EntityManager::checkCollision(Entity* ent1, Entity* ent2)
In the case they intersect, you return
return (cholided == true);
bt what you're doing is comparing cholided to true, and return the result of that.
Cholided is always set to false, so that comparison will always return false, since chomparison is not true.
Use
return true;
instead.
Also, you wouldn't need the variable cholided. Just return false in every case except the last.
Posted by __SKYe
on 26 February 2013 - 05:26 PM
If you want to learn something that alows you to make professional quality games, then:
If you're targeting Windows only (and i think XboX 360 works too), then i'd say DirectX is the way to go. Most of today's most famous games use it.
If you're targeting multiple platforms you may want to learn OpenGL. Note that OpenGL doesn't provide many tools like DirectX does, OpenGL is just a graphics API.
OpenGL i also available fr mobile platforms in the form of OpenGL ES.
If you want to make a game for various platforms including mobile then you could use Unity.
There are also open source game engine you could use, like OGRE (although OGRE is a graphics engine only), Irrlicht, etc.
Other people should tell other popular choices i don't know (or didn't remember) about.
Hope it helps.
Posted by __SKYe
on 23 February 2013 - 08:20 PM
glGetError returns the current error state of the OpenGL state machine. After calling glGetError, the error state reverts to GL_NO_ERROR and it will remain so until an OpenGL function is called which sets an error state.
That is not entirely correct.
If you check http://www.opengl.org/sdk/docs/man/xhtml/glGetError.xml, you'll find that more than one error may be recorded by OpenGL, and that glGetError() should be called in a loop until GL_NO_ERROR is returned.
Posted by __SKYe
on 23 February 2013 - 08:12 PM
If the model has been created and textured mapped correctly, then those coordinates mean that the texture repeats when mapped to the model.
In order to make it show correctly on your program, when you load the texture the model uses, you have to set the wrap mode to repeat instead of clamp.
For example, in OpenGL you'd do this:
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT);
You can also try GL_MIRRORED_REPEAT instead of GL_REPEAT if it doesn't appear correct.
See if it works.
Posted by __SKYe
on 16 February 2013 - 07:39 PM
First, when you draw you call
glRotatef(30, 1, 1, 0)
And after drawing you call:
glRotatef(-30, -1, -1, 0)
. To reverse the rotation, you only need to change the sign of the degrees, not the axis, so it should be:
glRotatef(-30, 1, 1, 0);
To avoid this (and to make it easier), instead of doing this:
glTranslatef(self.position[0], self.position[1], self.position[2]) glRotate(30, 1, 1, 0) ... draw ... glRotate(-30, 1, 1, 0) glTranslatef(-self.position[0], -self.position[1], -self.position[2])
do
glPushMatrix(); glTranslatef(self.position[0], self.position[1], self.position[2]) glRotate(30, 1, 1, 0) ... draw ... glPopMatrix();
This way, between glPushMatrix() and glPopMatrix(), you can do whatever transformations you want, that it won't affect the previous matrix.
I don't know if this is exactly your problem, but when you draw the cubes, you're translating them first and then rotating.
In this case, the farther away the cube is from the origin, the longer will be the rotation, because it will be rotating around the axis and not around itself.
Again, i don't know if this is intentional or not, if it is then forget it.
I don't really know Python, but this seems to be a problem with OpenGL, so i hope it helps.
Also, unless the OpenGL spec is different for Python, shouldn't the glRotate() call be glRotatef() (or glRotated() if your using doubles)?
Posted by __SKYe
on 15 February 2013 - 02:10 PM
I'm not entirely sure about this, but i think this is correct:
Eclise is an IDE (Integration Developing(Developer) Environment. It has a text editor (where you code), sintax highlighting, etc.
JDK (Java Development Kit) - This is the Java equivalent to a SDK (Software Development Kit). It allows you to compile and create java programs into Java bytecode (.jar files).
You'd normally download this in conjunction with Eclipse or NetBeans (the IDEs normally allow you to download a bundle of IDE + JDK).
JRE (Java Runtime Environment) is needed fr running the JVM (Java Virtual Machine). Since Java is an interpreted language, it need the JVM to translate the Java bytecode into machine instructions (which can be x86, x86-64, PowerPC, etc). You can think of JRE being similar, in purpose, to Adobe Flash Player (without which you cannot play videos on the Youtube, etc).
If the user doesn't have the JRE, it can be downloaded for free in the Sun website (you just Google jre, and it will appear).
So JDK is only needed for who develops Java applications, and JRE is needed to run them.
Hope it helps.
Posted by __SKYe
on 15 February 2013 - 10:40 AM
Again, i don't know how to remove the console when using GLUT (although, in DevC++ you have an option of not creating a console window).
But you shouldn't worry about it too much, after all you're just starting out. When you get used to it, you will probably use the Windows API to create the window, and then no console will appear.
And yes, when you give your program to a friend you he has to have the DLL too. But this is not uncommon, if you want to give your program to someone, just send it along with the DLL, and that's it.
If you want, go to the folder of any game you have installed on your computer, and check if there are any DLL. They probably are there, so it's really common stuff.
Posted by __SKYe
on 15 February 2013 - 07:34 AM
For the language I'll always advise C++, because that's probably the most used language, especially in game development, not to mention it's my favorite language, and the one i always use. But don't let me stop you from trying other languages, just ask other people and they will surely point out the good in any of them.
I know you can use LWJGL (which is a way to use OpenGL (and more, i think) on Java).
Now, if you don't know C++ yet, or you think you don't know enough (and assuming that's the language you're going to learn), for now you should set apart the idea of making a game.
First you must use how to program in C++, and i mean really learn it (advanced stuff like pointers, classes, inheritance, templates, overloading, etc).
If you want online tutorials on C++, you can go to http://www.cplusplus.com/doc/tutorial/ and follow the tutorials there. They point out most of the C++ features you should know, although some of them take a lot of practice to perfect (like pointers).
Also, you should read about design patterns (after getting a good grasp on the language). They will help you designing better code.
After you have a good grasp in the language you can then start learning OpenGL.
Also, it would do you good to decide whether you want to learn the deprecated OpenGL functionality or not. I can't really said if it helps or not, but when i first learned OpenGL, i started there, so maybe when i learned shader based OpenGL the learning curve wasn't that difficult.
I'll let others advise more on this.
More than this, remember that a game is not only graphics (although graphics is a big part of them).
You could then learn OpenAL for audio (or FMOD, for example), DirectInput (on Windows only) for input, and a lot more.
Other than that i can only say to keep practicing. As they say, practice makes perfect (or at least close).
Posted by __SKYe
on 15 February 2013 - 06:54 AM
For Windows, i prefer VC++ 2010/2012. For any other OS Code::Blocks is a choice, although i think there's some other good IDE for MacOSX that i don't remember the name.