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.


Topics - inlinevoid

Pages: [1]
1
DotNet / SFML hanging on RenderWindow close.
« on: June 06, 2013, 11:38:47 pm »
I'm testing out SFML in C# and am having a slight problem.  When closing the window, or even just letting the main thread exit, the window itself will close but the program will hang for about 10 seconds before actually closing.  I'd appreciate any solutions.

namespace SFMLNET_Test
{
    class Program
    {
        static void Main(string[] args)
        {
            RenderWindow window = new RenderWindow(new VideoMode(1280, 720), "SFML", Styles.Close);
            window.Close();
        }
    }
}

2
General / Image and Font causes crashes at program exit
« on: March 21, 2011, 03:08:41 am »
Let me start off by giving you some info:
OS: Windows 7
Graphics Driver: ATI CCC 10.10
IDE: VS2010
SFML: SFML2.0

Alright, so I can't seem to globally declare an Image or a Font.

For example, I've got a class with a static vector of Images, Fonts, and SoundBuffers, like so:
Code: [Select]

class DataManager
{
private:
static std::vector<sf::Image> imageData;
static std::vector<sf::SoundBuffer> soundData;
static std::vector<sf::Font> fontData;
};


And of course I'm defining the vectors in DataManager's .cpp file.  The problem is that global Images or Fonts give me an unhandled exception when the program closes then tells me the program crashed in crt0dat.c at line 708:
Code: [Select]

void __cdecl __crtExitProcess (
        int status
        )
{
        __crtCorExitProcess(status);

        /*
         * Either mscoree.dll isn't loaded,
         * or CorExitProcess isn't exported from mscoree.dll,
         * or CorExitProcess returned (should never happen).
         * Just call ExitProcess.
         */

        ExitProcess(status); /* 708 */
}


Declaring a SoundBuffer globally works just fine though.

3
General / SFML won't run in Windows 7 64-bit
« on: January 07, 2011, 09:15:39 pm »
I've just switched from XP 32-bit on to 7 64-bit and can't seem to get my projects to work anymore.  The problem is strange: the code compiles without any errors/warning but the renderwindow doesn't pop up, only the console window (which is frozen, I've tried some couts).

Oh and precompiled SFML samples run just fine.

Any thoughts?

4
General discussions / SFML/OGL graphic differences?
« on: November 07, 2010, 12:51:25 pm »
Alright so, quick question:

The functionality contained in Graphics.hpp is just a high-level interface to OpenGL, correct?

If so, what would be the advantages/disadvantages of using OpenGL instead of SFML's graphics?

5
Graphics / Image distortion?
« on: October 25, 2010, 01:28:06 am »
I seem to be getting this weird distortion around the corners of a sprite when it's rotated.

Like so:


You can clearly see it around the red guy because there's multiple copies on top of each other.  If you look closely you can see it around the green guy as well.

Like I said, it's only noticeable when the sprite is rotated and the distortion appears around the edges of the sprite.

Btw, the hands and the bodies are two different sprites (which is why you can see a gray box around the body and a bigger box around the whole thing).

Is this a bug or a common mistake in the code?

6
System / How can I disable SFML error output?
« on: October 14, 2010, 12:33:40 pm »
With the current project I'm working on, I'd like to be able to keep my console window color coded and formatted to a specific way to successful and non-successful loading.

The problem is the error output built into the LoadFromFile methods makes my console window look quite messy (since everything is color coded and has a specific format, the gray line that is printed doesn't match the rest of the console).

Is there anyway I can disable this?

EDIT: To make things as clear as possible, this is what I'm talking about:
Quote

Image 0 loaded!
  Filepath: assets/gfx/default.png
  Identifier: default
Image 1 loaded!
  Filepath: assets/gfx/stick.png
  Identifier: stick
Image 2 loaded!
  Filepath: assets/gfx/delphine.png
  Identifier: player
Failed to load image "assets/gfx/fluffy-grass.pn". Reason : Unable to open file (I don't want this line showing)
Image 3 failed to load!
  Filepath: assets/gfx/fluffy-grass.pn
  Identifier: grass
Sound 1 loaded!
  Filename: assets/sfx/NOSOUND.ogg
  Identifier: NOSOUND

7
Graphics / sf::Sprite problem with std::vector
« on: August 12, 2010, 03:19:22 pm »
Hello I've been having a problem with using a vector of sf::Sprites/sf::Images:

Code: [Select]

std::vector<sf::Image> IMAGE;
std::vector<sf::Sprite> SPRITE;

IMAGE.push_back(sf::Image());
SPRITE.push_back(sf::Sprite());
IMAGE.at(0).LoadFromFile("Remilia0.png");
SPRITE.at(0).SetImage(IMAGE.at(0));

IMAGE.push_back(sf::Image());
SPRITE.push_back(sf::Sprite());
IMAGE.at(1).LoadFromFile("Remilia1.png");
SPRITE.at(1).SetImage(IMAGE.at(1));

IMAGE.push_back(sf::Image());
SPRITE.push_back(sf::Sprite());
IMAGE.at(2).LoadFromFile("Remilia2.png");
SPRITE.at(2).SetImage(IMAGE.at(2));

IMAGE.push_back(sf::Image());
SPRITE.push_back(sf::Sprite());
IMAGE.at(3).LoadFromFile("Remilia3.png");
SPRITE.at(3).SetImage(IMAGE.at(3));

IMAGE.push_back(sf::Image());
SPRITE.push_back(sf::Sprite());
IMAGE.at(4).LoadFromFile("Remilia4.png");
SPRITE.at(4).SetImage(IMAGE.at(4));

SPRITE.at(0).SetPosition(20, 20);
SPRITE.at(1).SetPosition(60, 20);
SPRITE.at(2).SetPosition(100, 20);
SPRITE.at(3).SetPosition(140, 20);
SPRITE.at(4).SetPosition(180, 20);

while(Window.IsOpened())
{
Window.GetEvent(Event);
if(Event.Type == sf::Event::Closed)Window.Close();
Window.Clear();
Window.Draw(SPRITE.at(0));
Window.Draw(SPRITE.at(1));
Window.Draw(SPRITE.at(2));
Window.Draw(SPRITE.at(3));
Window.Draw(SPRITE.at(4));
Window.Display();
}


It seems as though when I push a new Sprite (or Image) into their vectors all of the other objects get erased because every sprite shows up as a white square except for the last sprite to be pushed into the vector (SPRITE.at(4) draws fine).

Can someone explain why this is happening?

BTW: I'm using SFML 1.6 in VS08

8
General / SFML 1.6 Runtime errors
« on: April 17, 2010, 05:35:19 am »
Alright so I just upgraded to 1.6 and I can't get even a simple program running correctly.  Maybe I'm getting a little rusty seeing as how I wrote an SFML engine for all of my games and never actually had to write any SFML code in the past month.  

Let me list how I have everything set up and tell me if I'm missing something.

Preprocessor
    SFML_DYNAMIC


Linker dependencies
    sfml-graphics-d.lib
    sfml-system-d.lib
    sfml-audio-d.lib
    sfml-window-d.lib


Source

Code: [Select]

#include <SFML/Graphics.hpp>
int main()
{
    sf::RenderWindow App(sf::VideoMode(800, 600, 32), "SFML Graphics");
sf::Event Event;
    while (App.IsOpened())
    {
App.GetEvent(Event);
if(Event.Type == sf::Event::Closed)App.Close();
        App.Clear();
        App.Display();
    }

    return EXIT_SUCCESS;
}


All of the headers, libs, DLL's are in the right place and I'm using MSVC08.  Not sure what the problem is here but I'm getting a runtime error at App.Clear();

I've tried creating a couple different projects to see if I'm messing anything up by accident but they all have the same results.

9
Audio / Internal OpenAL call failed in soundbuffer.cpp (74)
« on: February 05, 2010, 04:38:18 am »
Hello,  whenever I try to load a new sound buffer and apply it to a sound class in a vector I get this error message in the cmd prompt "An internal OpenAL call failed in soundbuffer.cpp (74) : AL_INVALID_OPERATION, the specified operation is not allowed in the current state"

Here is the code...

Code: [Select]

struct SoundFile
{
std::string Name;
float Vol;
SoundBuffer Buffer;
Sound Sound;
};

class Sfx
{
private:
RenderWindow & renderwindow;
vector<SoundFile> Soundtest;

public:
Sfx(RenderWindow & Screen): renderwindow(Screen){}
void Sfx::LoadSoundFile(std::string filename, float Volume);
};

void Sfx::LoadSoundFile(std::string filename, float Volume)
{
Soundtest.resize(Soundtest.capacity()+1);
Soundtest.at(Soundtest.size()-1).Buffer.LoadFromFile(filename);
Soundtest.at(Soundtest.size()-1).Name = filename;
Soundtest.at(Soundtest.size()-1).Vol = Volume;
Soundtest.at(Soundtest.size()-1).Sound.SetBuffer(Soundtest.at(Soundtest.size()-1).Buffer);
Soundtest.at(Soundtest.size()-1).Sound.SetVolume(Volume);

cout << Soundtest.size()-1 << " loaded: " << filename << endl;
}


I call LoadSoundFile("sound.wav", 100) from main and the first one loads fine without any error.  Anyone other one I load after that will give me that error message.  The program doesn't crash or anything it just shows the error in the cmd window while the program is running.  The message appears when I call Soundtest.resize(Soundtest.capacity()+1).  Any ideas?

10
General / Trouble understanding SFML
« on: December 29, 2009, 01:00:44 am »
Since I'm one of the people switching from Allegro to SFML I'm just having a bit of trouble understanding how to correctly use the API (my brain is stuck to think in the way that works for Allegro).  My main problem right now is not knowing where to correctly use sf::Event, sf:: Input, and sf::RenderWindow.  Like if I have a separate function for my games main menu, another function for the options screen, and another function for the actual game itself do I need to create a whole new set of Event, Input, and RenderWindow classes for each function?  Example:

Code: [Select]
void main_menu_loop()
{
// New RenderWindow?
// New Input?
// New Event?

/*
The main menu loop.
*/
}

 int main()
{
RenderWindow Screen(VideoMode(800, 600, 32), "DUEL", Style::Close);
const Input & iInput = Screen.GetInput();
Event eEvent;

main_menu_loop();
while(Screen.IsOpened())
{
//Main game loop
}
return 0;
}


And another thing...  is there a way to quickly output numbers to the screen?  sf::String doesn't work with integers (atleast it won't for me).

-Thanks in advance.

11
Graphics / Displaying Numbers
« on: December 12, 2009, 05:47:42 am »
Just a quick question... How would I go about displaying variables like int, float, double, etc.

This won't work: sf::String Player1Score(iScore, Font, 50);

Is there some separate function for displaying numbers instead of a string of text or do I have to manually convert the integer into a string before displaying it each time?

Thanks in advance.

Pages: [1]
anything