Register for your free account! | Forgot your password?

Go Back   elitepvpers > Coders Den > C/C++
You last visited: Today at 16:51

  • Please register to post and access all features, it's quick, easy and FREE!

Advertisement



background in console drawn!

Discussion on background in console drawn! within the C/C++ forum part of the Coders Den category.

Reply
 
Old   #1
 
elite*gold: 0
Join Date: Mar 2011
Posts: 124
Received Thanks: 3
background in console drawn!

Hey Leute !

Ich arbeite zur Zeit mit SDL und c++ und möchte ein einfaches Bild in meiner Console darstellen.
Jetzt habe ich diesen einfachen Code hier, aber unten bei apply_surface(0,0,background,screen); sagt er das apply_surface falsch ist.

Error: Der Bezeichner ""apply_surface"" ist nicht definiert.

Code:
#include <SDL.h>

SDL_Surface *screen = NULL;
SDL_Surface *background = NULL;

bool gameRunning = true;
SDL_Event event;

void applay_surface(int x, int y, SDL_Surface* source, SDL_Surface* destination)
{
	SDL_Rect rect;
	rect.x = x;
	rect.y = y;

	SDL_BlitSurface(source,NULL,destination,&rect);
}

int main(int argc, char* argv[])
{
	//Init
	SDL_Init(SDL_INIT_VIDEO);
	SDL_WM_SetCaption("Apply image to screen",NULL);

	//Load
	screen = SDL_SetVideoMode(640,480,32,SDL_SWSURFACE);
	background = SDL_LoadBMP("background.bmp");

	//Game Loop
	while(gameRunning)
	{
		if(SDL_PollEvent(&event));
		{
			if(event.type == SDL_QUIT)
			{
				gameRunning = false;
			}
		}
	 
		//Apply surface
		apply_surface(0,0,background,screen);

		//update screen
		SDL_Flip(screen);

	}

	if (event.type==SDL_QUIT)
	return 0;
}
nawiat is offline  
Old 03/28/2013, 17:00   #2
 
Dr. Coxxy's Avatar
 
elite*gold: 0
Join Date: Feb 2011
Posts: 1,206
Received Thanks: 736
Code:
void [U]appl[COLOR="Red"]a[/COLOR]y_surface[/U](int x, int y, SDL_Surface* source, SDL_Surface* destination)
u serious?
Dr. Coxxy is offline  
Thanks
1 User
Old 03/28/2013, 17:04   #3
 
elite*gold: 0
Join Date: Mar 2011
Posts: 124
Received Thanks: 3
OHH MAN ;D
Danke man, so schnell kann man ein Fehler einbauen

Sry Leute !
nawiat is offline  
Reply


Similar Threads Similar Threads
BoxyBot Background's with GG's Background
11/26/2016 - DarkOrbit - 8 Replies
BoxyBot Hintergrundbilder Hier sind die Piratenmaps zu sehen im Hintergrund und die Galaxy Gate Map's falls ihr ja im GG seit weil dieses schwaze Hintergrund ist ja schei*** Ich weiß es gibt schon einen Therad mit den Hintergrunden aber es gab sie nicht mit den Piraten Maps & GG's also habe ich mal bisschen daran rumgespielt. Anleitung : 1) Entpackt : BoxyBot Backgrounds 2) BoxyBot Ordner öffnen
Wie stellt man die Console ein oder für was ist die console genau?
02/10/2013 - Rappelz Private Server - 3 Replies
Hallo und zwar wollte ich fragen was die Console Genau ist, und wie man diese dann Richtig einstellen tut. Wäre sehr nett wen ihr mir dabei Helfen könnt. Google und suche hier bei epvp haben bis jetzt nicht´s gefunden. Falls es euch hilft ich habe 7.3 Files Auth, Ubload, und Gameserver Funktionieren Einwandfrei.
Hand-drawn Design
12/11/2011 - elite*gold Trading - 13 Replies
Hey Leute, hier biete ich an, handgezeichnete Werke für euch zu designen... Einfach sagen was ihr wollt... Egal was, ich mache es... Logo - Signatur - Avatar - Buttons... Egal was... Na ja... okay... vielleicht Webdesign nicht, aber sonst alles... :) Preise der Werke Logo Signatur Avatar
[RELEASE] Console Commands for Lame Console Look
12/07/2011 - CO2 PServer Guides & Releases - 12 Replies
Well, to avoid any further useless posts on this subject... here are a ton of console based commands that will control the game from the server console. I will not explain what each does, it should be pretty easy to figure out, and I don't intend to answer stupid questions. If its a good question, I will answer it. public static void DoStuff() { bool flag = true; Console.Clear(); Console.ForegroundColor = ConsoleColor.Red; ...



All times are GMT +2. The time now is 16:53.


Powered by vBulletin®
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.
This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

Support | Contact Us | FAQ | Advertising | Privacy Policy | Terms of Service | Abuse
Copyright ©2024 elitepvpers All Rights Reserved.