[C-SDL] Création flooder

Moderator: Mod

[C-SDL] Création flooder

Postby DM5087 » Sat Apr 12, 2008 2:19 pm

Bonjour à tous, j'aimerais bien créer un ptit flooder avec SDL mais à part l'interface je ne sais pas quoi faire...

[code:1:a06b5b401b]
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <ctype.h>
#include <SDL/SDL.h>
#include <SDL/SDL_ttf.h>
#include "saisieSDL.h"
#include <SDL/SDL_image.h>


int main( int argc, char* argv[] )
{
SDL_Event event;
SDL_Rect pos = { 0, 0, 0, 0 };
SDL_Color couleur = { 255, 255, 255, 32 },
a = { 255, 255, 255, 32 };
int continuer = 1;
SDL_Rect position;
saisieSDL *saisie = NULL;
TTF_Font *police = NULL;
int quitter = 0;
SDL_Init(SDL_INIT_VIDEO);
TTF_Init();
SDL_Surface *ecran = NULL, *imageDeFond = NULL, *texte = NULL, *texte1 = NULL, *texte2 = NULL, *texte3 = NULL, *texte4 = NULL, *texte5 = NULL, *texte6 = NULL, *fond = NULL, *sapin = NULL;
SDL_Rect positionFond, positionSapin;
positionFond.x = 0;
positionFond.y = 0;

ecran = SDL_SetVideoMode(400, 400, 32, SDL_HWSURFACE);
SDL_WM_SetCaption("DM5087 flooder 1.0 * * * BETA * * *", NULL);
SDL_FillRect(ecran, NULL, SDL_MapRGB(ecran->format, 255, 255, 255));
imageDeFond = SDL_LoadBMP("background.bmp");
SDL_BlitSurface(imageDeFond, NULL, ecran, &positionFond);
SDL_Flip(ecran); /* Mise à jour de l'écran avec sa nouvelle couleur */
police = TTF_OpenFont("arial.ttf", 14); /* Ouverture de la police au début */
texte = TTF_RenderText_Blended(police, "Flooder: Temps avantde commancer à flooder:", a);
position.x = 10;
position.y = 50;
SDL_BlitSurface(texte, NULL, ecran, &position); /* Blit du texte par-dessus */
SDL_Flip(ecran);


texte1 = TTF_RenderText_Blended(police, "Flooder: Nombre de messages:", a);
position.x = 10;
position.y = 90;
SDL_BlitSurface(texte1, NULL, ecran, &position); /* Blit du texte par-dessus */
SDL_Flip(ecran);


texte2 = TTF_RenderText_Blended(police, "Flooder: Message:", a);
position.x = 10;
position.y = 130;
SDL_BlitSurface(texte2, NULL, ecran, &position); /* Blit du texte par-dessus */
SDL_Flip(ecran);


texte3 = TTF_RenderText_Blended(police, "Flooder Created by DM5087", a);
position.x = 10;
position.y = 250;
SDL_BlitSurface(texte3, NULL, ecran, &position); /* Blit du texte par-dessus */
SDL_Flip(ecran);


texte4 = TTF_RenderText_Blended(police, "Contactes:", a);
position.x = 10;
position.y = 300;
SDL_BlitSurface(texte4, NULL, ecran, &position); /* Blit du texte par-dessus */
SDL_Flip(ecran);


texte5 = TTF_RenderText_Blended(police, "web: http://dm5087.free.fr", a);
position.x = 10;
position.y = 340;
SDL_BlitSurface(texte5, NULL, ecran, &position); /* Blit du texte par-dessus */
SDL_Flip(ecran);


texte6 = TTF_RenderText_Blended(police, "mail: ****.****@****.**", a); /* je l'ai caché pour vité les spams */
position.x = 10;
position.y = 360;
SDL_BlitSurface(texte6, NULL, ecran, &position); /* Blit du texte par-dessus */
SDL_Flip(ecran);


if(( saisie = creerSaisieSDL( 15 )) == NULL ) {
TTF_CloseFont( police );
}

SDL_EnableUNICODE( 1 );
do {
SDL_Flip( ecran );
SDL_WaitEvent( &event );
switch( event.type ) {
case SDL_QUIT:
quitter = 1;
break;
case SDL_KEYDOWN:
if( event.key.keysym.unicode == SDLK_1 ) {
saisirSDL( saisie, ecran, police, pos,
couleur, a, FOND_UNI, 1 );
}
break;
default:
break;
}
} while( !quitter );



libererSaisieSDL( saisie );
TTF_CloseFont( police );
TTF_Quit();
SDL_FreeSurface(texte);
SDL_Quit();
return EXIT_SUCCESS;

}
[/code:1:a06b5b401b]

Si quelqu'un pouvais me dire comment faire la zone de saisie car elle est invisible ...

Sinon apres il faudrait faire les boucles(juste à lire le tuto la dessus sur le sdz), coller(j'ai recherché mais pas trouvé en C), et le boutton(aucune idée)

Voila merci !
DM5087
Projets
 
Posts: 42
Joined: Thu Aug 16, 2007 10:02 pm
Location: ta pas ? savoir

Postby warmup » Wed May 14, 2008 2:08 pm

Je pense pas que tu arriveras a faire ça avec la SDL ;) elle est plutot destiné au jeu, enfin apres je sais pas je suis pas un expert de la SDL

Mais je pense tu devrais plustot utiliser l'API Windows ou encore Gtk+ qui est plus facil que l'API Windows :)
warmup
Projets
 
Posts: 81
Joined: Sun Dec 30, 2007 11:29 am

Postby NETTOYEUR25 » Mon Aug 10, 2009 3:29 am

Null, c'est vraiment nulle !
User avatar
NETTOYEUR25
Projets
 
Posts: 1235
Joined: Wed Oct 31, 2007 2:20 am
Location: B

Postby S » Tue Aug 11, 2009 1:42 am

[quote:35afa8383b="warmup"]Je pense pas que tu arriveras a faire ça avec la SDL ;) elle est plutot destiné au jeu, enfin apres je sais pas je suis pas un expert de la SDL

Mais je pense tu devrais plustot utiliser l'API Windows ou encore Gtk+ qui est plus facil que l'API Windows :)[/quote:35afa8383b]
La sdl sera utilisé pour l'interface mais rien ne l'empêche de faire autre chose, n'oublions pas qu'on est avec le bon vieux C qui sais faire tous (ou presque), cherche du coté des socket si j'ai bien compris ce que tu veux faire
S
Projets
 
Posts: 271
Joined: Thu Mar 27, 2008 2:46 am

Postby Sliim » Tue Aug 11, 2009 8:43 am

Pour infos la question a été posé il y a plus d'un an. A moins que DM5087 repasse par là c'est pas la peine de vous fatiguer avant d'avoir des signes de présence de ce membre ^^.

++
[u:6c48c27f26]Sliim[/u:6c48c27f26]
User avatar
Sliim
Site Admin
 
Posts: 1177
Joined: Fri May 16, 2008 12:53 pm


Return to C/C++

Who is online

Users browsing this forum: No registered users and 3 guests

cron