C++ game programming compilers ...etc.

Started by
14 comments, last by MonkeyCookie 19 years, 4 months ago
Hey, I am 14, and a little new to C++, but I have experience with GML, and Java, I need to know if it is possible to create games with Dev C++, like adventure games, and do you know of any C++ programs that i can develop games on? it would be nice if they are free :D
I'm 14,i design games,and I own CCGames,i have made about 15 games,mostly with Game Maker,PM me if you know how to create a level editor on GM :Pwww.coryandgrant.uni.cchttp://s4.invisionfree.com/ccgames_community JOIN!!!
Advertisement
dev-c++ is an ide that comes with the MinGW compiler with it. which means yes you can create games. i suggest reading a book on c++ or just use online tutorials. once you are a little bit more familiar with c++ then i suggest you look into SDL (Simple Direct Media Layer) which is a graphics / game library. this can be download right from the dev-c++ ide as well so it's not that hard to set up.

as for applications that you can make games with, there are quite a few programs that do this, but keep in mind this isnt *really* programming. although these programs are fun to use and give you a break from the technical side of game development you should really learn to program games yourself. the ones that come to mind are the rpg maker series, 3d games creator, and click n play.
Woop woop woop woop!
okay,
but could you maybe tell me?

also, does anyone know of any different free compilers?
I'm 14,i design games,and I own CCGames,i have made about 15 games,mostly with Game Maker,PM me if you know how to create a level editor on GM :Pwww.coryandgrant.uni.cchttp://s4.invisionfree.com/ccgames_community JOIN!!!
Dev-C++ with MinGW is probably the best for Windows and (possibly) linux(although, on linux, it'd use GCC instead of MinGW)
well how can i get this SDL and MinGW?

??
I have some code for a mario game
I'm 14,i design games,and I own CCGames,i have made about 15 games,mostly with Game Maker,PM me if you know how to create a level editor on GM :Pwww.coryandgrant.uni.cchttp://s4.invisionfree.com/ccgames_community JOIN!!!
just google for bloodshed dev-c++ SDL can be download from dev-c++ by going to options i think then check for packages, just connect from there and you can select SDL and download / install it. then create a new project and select SDL it will have some example code there also. i suggest trying these tutorials as well.
Clicky
Woop woop woop woop!
should i get the runtime libraries or the developement package?
of SDL that is...
I'm 14,i design games,and I own CCGames,i have made about 15 games,mostly with Game Maker,PM me if you know how to create a level editor on GM :Pwww.coryandgrant.uni.cchttp://s4.invisionfree.com/ccgames_community JOIN!!!
You will need the development package, this has the extra things you need for development. (Header files ".h", library files ".lib" or ".obj", etc).

The runtime libraries are only useful for someone who has your program that is already compiled.
okay, i have that SDL devpak and well, i tried to compile this:
What's wrong with it :::
[brace]#include <stdio.h>
#include <stdlib.h>
#include <windows.h>
#include <string.h>
#include <libiberty.h>
#include "SDL.h"


/* The screen surface */
SDL_Surface *screen = NULL;


/* This function draws to the screen; replace this with your own code! */
static void
draw ()
{
static int direction = 0;
static int value = 0;
static int which = 0;
SDL_Rect rect;
Uint32 color;

/* Create a black background */
color = SDL_MapRGB (screen->format, 0, 0, 0);
SDL_FillRect (screen, NULL, color);

/* Determine which color the layer should have */
if (direction == 0)
{
value += 2;
if (value >= 256)
{
value = 255;
direction = 1;
}
}
else
{
value -= 2;
if (value <= 5)
{
value = 0;
direction = 0;
which++;
if (which == 5)
which = 0;
}
}

/* Draw a layer with variable color */
switch (which)
{
case 0:
color = SDL_MapRGB (screen->format, value, 0, 0);
break;
case 1:
color = SDL_MapRGB (screen->format, 0, value, 0);
break;
case 2:
color = SDL_MapRGB (screen->format, 0, 0, value);
break;
case 3:
color = SDL_MapRGB (screen->format, value, value, value);
break;
case 4:
color = SDL_MapRGB (screen->format, value, 0, value);
break;
}

rect.w = screen->w / 2;
rect.h = screen->h / 2;
rect.x = (screen->w / 2) - (rect.w / 2);
rect.y = (screen->h / 2) - (rect.h / 2);
SDL_FillRect (screen, &rect, color);


/* Make sure everything is displayed on screen */
SDL_Flip (screen);
/* Don't run too fast */
SDL_Delay (1);
}


int
main (int argc, char *argv[])
{
char *msg;
int done;

/* Initialize SDL */
if (SDL_Init (SDL_INIT_VIDEO) < 0)
{
asprintf (&msg, "Couldn't initialize SDL: %s\n", SDL_GetError ());
MessageBox (0, msg, "Error", MB_ICONHAND);
free (msg);
exit (1);
}
atexit (SDL_Quit);

/* Set 640x480 16-bits video mode */
screen = SDL_SetVideoMode (640, 480, 16, SDL_SWSURFACE | SDL_DOUBLEBUF);
if (screen == NULL)
{
asprintf (&msg, "Couldn't set 640x480x16 video mode: %s\n",
SDL_GetError ());
MessageBox (0, msg, "Error", MB_ICONHAND);
free (msg);
exit (2);
}
SDL_WM_SetCaption ("SDL MultiMedia Application", NULL);

done = 0;
while (!done)
{
SDL_Event event;

/* Check for events */
while (SDL_PollEvent (&event))
{
switch (event.type)
{
case SDL_KEYDOWN:
break;
case SDL_QUIT:
done = 1;
break;
default:
break;
}
}

/* Draw to screen */
draw ();
}

return 0;
}[/brace]

AND here's the Error messages I get:::

Quote:Compiler: Default compiler
Building Makefile: "C:\Dev-Cpp\Makefile.win"
Executing make...
make.exe -f "C:\Dev-Cpp\Makefile.win" all
g++.exe -c sdl.cpp -o sdl.o -I"C:/Dev-Cpp/include/c++/3.3.1" -I"C:/Dev-Cpp/include/c++/3.3.1/mingw32" -I"C:/Dev-Cpp/include/c++/3.3.1/backward" -I"C:/Dev-Cpp/lib/gcc-lib/mingw32/3.3.1/include" -I"C:/Dev-Cpp/include"

sdl.cpp:5:23: libiberty.h: No such file or directory
sdl.cpp:6:17: SDL.h: No such file or directory
sdl.cpp:10: error: syntax error before `*' token
sdl.cpp: In function `void draw()':
sdl.cpp:20: error: `SDL_Rect' undeclared (first use this function)

sdl.cpp:20: error: (Each undeclared identifier is reported only once for each

function it appears in.)
sdl.cpp:20: error: syntax error before `;' token
sdl.cpp:21: error: `Uint32' undeclared (first use this function)
sdl.cpp:24: error: `color' undeclared (first use this function)
sdl.cpp:24: error: `screen' undeclared (first use this function)
sdl.cpp:24: error: `SDL_MapRGB' undeclared (first use this function)
sdl.cpp:25: error: `SDL_FillRect' undeclared (first use this function)
sdl.cpp:70: error: `rect' undeclared (first use this function)
sdl.cpp:78: error: `SDL_Flip' undeclared (first use this function)
sdl.cpp:80: error: `SDL_Delay' undeclared (first use this function)

sdl.cpp: In function `int main(int, char**)':
sdl.cpp:91: error: `SDL_INIT_VIDEO' undeclared (first use this function)
sdl.cpp:91: error: `SDL_Init' undeclared (first use this function)
sdl.cpp:93: error: `SDL_GetError' undeclared (first use this function)
sdl.cpp:93: error: `asprintf' undeclared (first use this function)

sdl.cpp:98: error: `SDL_Quit' undeclared (first use this function)
sdl.cpp:101: error: `SDL_SWSURFACE' undeclared (first use this function)
sdl.cpp:101: error: `SDL_DOUBLEBUF' undeclared (first use this function)
sdl.cpp:101: error: `SDL_SetVideoMode' undeclared (first use this function)
sdl.cpp:110: error: `SDL_WM_SetCaption' undeclared (first use this function)
sdl.cpp:115: error: `SDL_Event' undeclared (first use this function)
sdl.cpp:115: error: syntax error before `;' token
sdl.cpp:118: error: `event' undeclared (first use this function)
sdl.cpp:118: error: `SDL_PollEvent' undeclared (first use this function)
sdl.cpp:122: error: `SDL_KEYDOWN' undeclared (first use this function)

sdl.cpp:124: error: `SDL_QUIT' undeclared (first use this function)

make.exe: *** [sdl.o] Error 1

Execution terminated


Do you know how I can fix this? It says it doesn't know what SDL.h or libiberty.h is???

Please help me;;;
Please...

[Edited by - ccgames on November 28, 2004 11:32:05 AM]
I'm 14,i design games,and I own CCGames,i have made about 15 games,mostly with Game Maker,PM me if you know how to create a level editor on GM :Pwww.coryandgrant.uni.cchttp://s4.invisionfree.com/ccgames_community JOIN!!!
define under braces!!

and remove libiberty.h.. I really think you dont use it

This topic is closed to new replies.

Advertisement