Welcome, Guest. Please login or register. Did you miss your activation email?

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - andreaszdw

Pages: 1 [2]
16
Window / Valid modes
« on: March 11, 2009, 11:20:18 am »
Yes, I have done it with this:

Code: [Select]
unsigned int VideoModesCount = sf::VideoMode::GetModesCount();
for (unsigned int i = 0; i < VideoModesCount; ++i)
{
   sf::VideoMode Mode = sf::VideoMode::GetMode(i);
   // Mode is a valid video mode
   std::cout << "Mode " << Mode.Width << "-" << Mode.Height << "-" << Mode.BitsPerPixel << " is valid" << std::endl;
}


The mode is valid, but it doesn't work.

Andreas

17
Window / Fullscreen problem
« on: March 11, 2009, 08:02:38 am »
If I switch from windowed to fullscreen with this:

Code: [Select]

void CGameEngine::Init(const char* title, int width, int height, int bpp, bool fullscreen)
{
   App = new sf::RenderWindow (sf::VideoMode(width, height, bpp), title, sf::Style::Close);

   App->Close ();

   App->Create (sf::VideoMode(800, 600), "SFML Window", sf::Style::Fullscreen);

   App->SetFramerateLimit (60);
}


I get this message:

Quote

The requested video mode is not available, switching to a valid mode


Than the old resolution (not 800, 600 like wanted) is switched to fullscreen.

I have this problem only on linux. I have tested if 800, 600 is a valid mode.

What's my problem?

Andreas

18
Graphics / sprites movement stuttering
« on: March 06, 2009, 08:18:49 am »
If I move my sprites, it looks always like stuttering. What could be the problem?

How could I do smooth movement?

(The FPS of the program is 2000 or, the speed of my system couldn't be the problem)

The source is to find here:

http://code.google.com/p/sallb/source/browse/#svn/trunk

Bye
Andreas

19
General / Resources sound and music
« on: February 09, 2009, 09:53:59 am »
I know, this is not special for sfml but, can tell me someone a place where to get free sounds and music for games?

Andreas

20
Graphics / Font crashes Info
« on: January 13, 2009, 12:48:47 pm »
I'd tried it on Windows XP, with the MingW-Compiler and SFML 1.4 (the official download)

Sorry up to now I didn't use a debbugger.

I will try this at home with my Linux System.

21
Graphics / Error was unicode
« on: January 13, 2009, 09:59:44 am »
I had to change this line:

Code: [Select]
sf::String buftext ("Hello!", font, 15);

to this:

Code: [Select]
sf::String buftext (L"Hello!", font, 15);


Than everything was alright.

22
Graphics / Unicode was it
« on: January 12, 2009, 01:11:40 pm »
I found my error, it was unicode.

23
Graphics / Font crashes
« on: January 12, 2009, 11:58:10 am »
If I do this:

Code: [Select]

sf::Font font;

    // Create the main rendering window
    sf::RenderWindow App(sf::VideoMode(800, 600, 32), "Ballspiel");


// Load font file on disk
if (!font.LoadFromFile("font/Videophreak.ttf"))
return EXIT_FAILURE;

sf::String buftext ("Hello!", font, 15);


my program crashes.

What's wrong? (the fontfile is in the correct place for loading)

24
Graphics / Thank's - It works
« on: November 27, 2008, 10:24:12 am »
It was so simple - thank's a lot!  :oops:

25
Graphics / White Rectangle
« on: November 27, 2008, 10:13:13 am »
When I do this the tank is drawn only
as a white rectangle in the top left.

What's wrong?

Here is my CTank.h:

Code: [Select]

#ifndef __CTANK_H__
#define __CTANK_H__

class CTank
{
public:
CTank ();
~CTank ();
int LoadImages ();

public:
sf::Sprite *tanksprite;
};

#endif


Here is my CTank.cpp
Code: [Select]

#include <SFML/Graphics.hpp>

#include "CTank.h"

CTank::CTank ()
{
tanksprite = new sf::Sprite;
}

CTank::~CTank ()
{
}

int CTank::LoadImages ()
{
sf::Image Image;
if (!Image.LoadFromFile("../graphic/tank2.png"))
return EXIT_FAILURE;

tanksprite->SetImage (Image);

return 0;
}


Here is my Main:
Code: [Select]

#include <SFML/Graphics.hpp>
#include <SFML/System.hpp>
#include "CTank.h"


int main()
{
CTank *tt = new CTank;

tt->LoadImages ();

// Create the main window
sf::RenderWindow App(sf::VideoMode(800, 600), "Test Tank");

// Start the game loop
while (App.IsOpened())
{
// Process events
sf::Event Event;
while (App.GetEvent(Event))
{
// Close window : exit
if (Event.Type == sf::Event::Closed)
App.Close ();

if ((Event.Type == sf::Event::KeyPressed) && (Event.Key.Code == sf::Key::Escape))
App.Close ();
}

App.Draw (*tt->tanksprite);

// Update the window
App.Display ();
}

return EXIT_SUCCESS;
}

26
General discussions / collision detection
« on: March 02, 2008, 05:45:05 pm »
Hello,

has anyone a library with pixel-perfect-collision-detection, which can be used with SFML?

Andreas

Pages: 1 [2]
anything