Game Programming Team

Pages: 123456
closed account (NUj6URfi)
I think we should use sdl for keystates and sfml for graphics.
SFML events are the proper way to handle keystates. I also really doubt that you can mix the two libraries effectively.

EDIT: I don't know where I was going with that (the crossed-out text).
Last edited on
SFML events are the proper way to handle keystates.


Not necessarily, which is why SFML also gives you a way to check the real time state of keys. An option which I don't believe is provided for with SDL at all.
Does SDL seriously not give you access to real-time input? I guess that's not too bad, it just means you have to store the states yourself when you get an event.
Last edited on
Aright guys:

this is the idea of this project, correct me if im wrong:

- project will be in SFML, or at least for graphics.
- will be a turn based strategy game
- will be 2d
- i think were gonna need an artist btw.
- is lead by johny
- is on github
closed account (N36fSL3A)
Why use SDL for input if you have SFML?

Well I don't know SFML, so...
There's no reason to use SDL for input, SFML handles it at least as well as, if not better than SDL does.
Lumpkin wrote:
Well I don't know SFML, so...

I'd like to say from my very little experience that, though I've tried both libraries, SFML was easier to learn than SDL. Also, I'd like to suggest SFML since I am using SFML and its really great. I'd rather say it suits my requirements.

I'd not oppose SDL but rather be adamant about using SFML ;).

axtyax wrote:
project will be in SFML, or at least for graphics.
- will be a turn based strategy game

I'd suggest using SFML for the whole game cause as far as I can make out, the game's basic and and no one's targeting to make GTA or COD. So, please use only one library to begin with.

What is this strategy based game? Can you please elaborate if it's like card game, board game or what?

And if you guys are using SFML, I'd definitely try to join and help you out in making the game and also probably the artwork(mind you, I'm not Van Gogh).
I would just like to note that the examples posted by zereo...

That was SDL1.2 and not 2.0.

But for those who don't know SFML, then this project could be a good learning oportunity. Never shirk the chance to learn something new.

Now jonhy31, it is time for you to get this circus organized. Here is a proposed plan of attack.

You start with your game design. Decide an approach for solving the project and begin posting asignments.
Such as... you need a song composed, or you need a charcted designed, or sprite animation done.
Others will look at what you need and make a bid for the assignment. If they get the OK from you then they tackle the task. Once they think they are done they will submit the work for your approval. If you like, then you stick it in game. If not satisfied then they must rework it.
This process should continue until you think the game is complete along with end credits which include the names of all who worked on the game. Smiles all around and we have something to show off in our portfolios.
Good luck.
Last edited on
I agree with Manga about his 2nd point.
closed account (3qX21hU5)
I would just like to note that the examples posted by zereo...

That was SDL1.2 and not 2.0.


Well here is the similar SDL 2.0 example with some extra error checking code.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
//Using SDL and standard IO
#include <SDL.h>
#include <stdio.h>

//Screen dimension constants
const int SCREEN_WIDTH = 640;
const int SCREEN_HEIGHT = 480;

//Starts up SDL and creates window
bool init();

//Loads media
bool loadMedia();

//Frees media and shuts down SDL
void close();

//The window we'll be rendering to
SDL_Window* gWindow = NULL;
	
//The surface contained by the window
SDL_Surface* gScreenSurface = NULL;

//The image we will load and show on the screen
SDL_Surface* gHelloWorld = NULL;

bool init()
{
	//Initialization flag
	bool success = true;

	//Initialize SDL
	if( SDL_Init( SDL_INIT_VIDEO ) < 0 )
	{
		printf( "SDL could not initialize! SDL_Error: %s\n", SDL_GetError() );
		success = false;
	}
	else
	{
		//Create window
		gWindow = SDL_CreateWindow( "SDL Tutorial", SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED, SCREEN_WIDTH, SCREEN_HEIGHT, SDL_WINDOW_SHOWN );
		if( gWindow == NULL )
		{
			printf( "Window could not be created! SDL_Error: %s\n", SDL_GetError() );
			success = false;
		}
		else
		{
			//Get window surface
			gScreenSurface = SDL_GetWindowSurface( gWindow );
		}
	}

	return success;
}

bool loadMedia()
{
	//Loading success flag
	bool success = true;

	//Load splash image
	gHelloWorld = SDL_LoadBMP( "02_getting_an_image_on_the_screen/hello_world.bmp" );
	if( gHelloWorld == NULL )
	{
		printf( "Unable to load image %s! SDL Error: %s\n", "02_getting_an_image_on_the_screen/hello_world.bmp", SDL_GetError() );
		success = false;
	}

	return success;
}

void close()
{
	//Deallocate surface
	SDL_FreeSurface( gHelloWorld );
	gHelloWorld = NULL;

	//Destroy window
	SDL_DestroyWindow( gWindow );
	gWindow = NULL;

	//Quit SDL subsystems
	SDL_Quit();
}

int main( int argc, char* args[] )
{
	//Start up SDL and create window
	if( !init() )
	{
		printf( "Failed to initialize!\n" );
	}
	else
	{
		//Load media
		if( !loadMedia() )
		{
			printf( "Failed to load media!\n" );
		}
		else
		{
			//Apply the image
			SDL_BlitSurface( gHelloWorld, NULL, gScreenSurface, NULL );
			
			//Update the surface
			SDL_UpdateWindowSurface( gWindow );

			//Wait two seconds
			SDL_Delay( 2000 );
		}
	}

	//Free resources and close SDL
	close();

	return 0;
}
Last edited on
SDL 2.0
BlitSurface



Why bother to use 2.0 if you're not going to render properly? Blitting is slooooow

IMO it was a huge mistake to leave SDL_Surface in 2.0 like they did.
closed account (3qX21hU5)

SDL 2.0
BlitSurface



Why bother to use 2.0 if you're not going to render properly? Blitting is slooooow

IMO it was a huge mistake to leave SDL_Surface in 2.0 like they did.



Just posted the code straight from Lazyfoo's tutorials so you can take that up with them instead of me ;p (Though I agree with what you said).

To clarify why SDL_Surface should have just been removed from SDL 2.0 is because all SDL_Surface objects reside in system RAM and they use the system CPU which makes their graphics calculations extremely slow because the CPU is not optimized for graphics processing like the GPU is. So if you are using SDL 2.0 stay far away from SDL_Surface and instead use SDL_Texture.

I also have no idea why they kept blitting around either but that is just me.
Last edited on
OK guys we need to set up a mean of comunications. I would sugest something like freenode but if someone new another service like that I'm ok with that.
I myself am fine with the lounge and email...
closed account (3qX21hU5)
It probably wouldn't be viewed very well if you guys held your group discussions in lounge threads.

I would recommend if you are looking for real time communication (Though text or otherwise) get a Skype group together or even just a IRC channel.

For the project itself I would highly recommend the use of github to manage the project. It will take care of having a central place for the project's code, different forks and branches for people/groups working on the project, allows the team leader(s) to merge code in the main branch only after being reviewed by them or the whole group, and much more.

You could then also use the issues page as a forum for the group to discuss certain aspects of the project.

But anyways I think if will leave you guys to it and wish you guys the best of luck with your project.
So the IRC channel has been set up by me.

It's in irc.foonetic.com server and the channel is #TBSG

Those who want in on the project say it in this thread so I can PM you the password
I've always wondered how to "set up" an irc channel...they're not persistent, you just type in a name and it creates it, so what setup is there?
You use a IRC client. In the IRC Client you type /join #whateverthenameofthechanelyouwant then inside of that you type /msg chanserv REGISTER #channelname password description.

They aren't persistent so you have to have one of the OP's on all the time.
They aren't persistent so you have to have one of the OP's on all the time.


I thought they were? Otherwise what's the point of registering them?
Pages: 123456