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 - inlinevoid

Pages: 1 2 [3] 4
31
SFML projects / Open Source top-down game - Warlock's Gauntlet
« on: October 14, 2010, 04:10:10 am »
I've noticed the music is ripped from Lugaru.

Nice work though, it's extremely polished and pretty fun to play.  I'm a HUGE Diablo fan so I definitely enjoyed this.

32
Graphics / sf::Sprite problem with std::vector
« on: August 12, 2010, 04:07:34 pm »
Ah alright.  Thanks again.

33
Graphics / sf::Sprite problem with std::vector
« on: August 12, 2010, 03:56:39 pm »
Actually... it should be fine, shouldn't it?  After I push the image/sprite into their vectors that's when I load the data and then assign the sprite to the image so the image isn't moving...

34
Graphics / sf::Sprite problem with std::vector
« on: August 12, 2010, 03:50:07 pm »
Ahhhh ok I see, thanks.

35
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

36
General / SFML 1.6 Runtime errors
« on: April 17, 2010, 08:56:23 pm »
Quote from: "Ashenwraith"
Are you sure you set them properly and the folders are correct?

You could try setting your link order to

sfml-audio.dll
sfml-graphics.dll
sfml-window.dll
sfml-system.dll


Nope, doesn't work.  I'm positive I have everything in the right folders, too.

37
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.

38
Audio / Internal OpenAL call failed in soundbuffer.cpp (74)
« on: February 06, 2010, 05:06:46 am »
Thanks Laurent, I'll mess around with it a bit tonight and see if I can get it working or not.

Btw the capacity() was size() before,  I changed it just before I pasted the code. :)

39
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?

40
General / Trouble understanding SFML
« on: January 01, 2010, 10:49:43 pm »
Gah I didn't even think to try Sprite or Image.  They both work fine so yea it might just be string...  I'll do some research.

If I get stuck again I'll post back here.  Thanks for the help Laurent.

41
General / Trouble understanding SFML
« on: January 01, 2010, 10:00:03 pm »
clsMenuText is global... If I create a clsMenuText object in main it will still give runtime errors when I exit the program.

Code: [Select]

int main()
{
////////////////////////
//Declare everything
////////////////////////

clsMenuText MenuText1("Play", Kosh);
};


Something like that would crash because of the String SText in clsMenuText.  If I remove String SText (and the constructor using SText) then the program quits without problems....

Are you saying I need to have the classes inside main as well?

42
General / Trouble understanding SFML
« on: January 01, 2010, 03:18:39 am »
So you're saying I can't do something like this?

Code: [Select]

class clsMenuText
{
public:
menu(std::string sText, Font& fFont)
{
SText.SetFont(fFont);
SText.SetColor(Color(255, 255, 255));
SText.SetText(sText);
}
~menu()
{
}
String SText;
};


If I wanted to make a class that holds SFML classes how would I go about doing it?  I even tried deconstructing SText before I close the window but it's just no good.

43
General / Trouble understanding SFML
« on: December 31, 2009, 09:42:49 pm »
Lol I don't know what I was trying to show in that last post... sorry.  I was tired when I wrote that.

Code: [Select]


Font Kosh;

int main()
{
// All of the main code
}


If I declare the font, or any other SFML class, outside of main then I get the runtime error when I end the program and it just shows me the disassembly (doesn't lead me to anywhere in the code).

44
General / Trouble understanding SFML
« on: December 31, 2009, 08:42:58 am »
Ok I've read through the tutorials and they aren't telling me much (unless I missed something :/)  but heres my problem...  Whenever I try to declare anything outside of main my program will crash when I close it.

For example:

Code: [Select]


// Header files
#include <SFML/Graphics.hpp>
#include <SFML/System.hpp>

using namespace sf;

int main()
{
RenderWindow Screen(VideoMode(800, 600, 32), "DUEL", Style::Close);
Event eEvent;

Font Kosh;
Font Half;
Image imgMenu;

//Load fonts.
Kosh.LoadFromFile("Materials/Fonts/kosh.ttf", 30);
Half.LoadFromFile("Materials/Fonts/half.ttf", 30);

// Load images.
imgMenu.LoadFromFile("Materials/Graphics/menu_background.tga");

while(Screen.IsOpened())
{
Screen.GetEvent(eEvent);
if(eEvent.Type == Event::Closed)Screen.Close();
if(Screen.GetInput().IsKeyDown(Key::Escape))Screen.Close();

Screen.Clear();
Screen.Display();
}
return 0;
}


If I want to declare anything outside of the main loop my program has a runtime error when I close it...  Not sure what the problem is here.

45
General / Trouble understanding SFML
« on: December 30, 2009, 11:11:42 pm »
Thanks for the reply I'll go over the tutorials more thoroughly and see what I missed.  And with the number thing I know you can convert it with the standard library I just thought maybe sfml could do it automatically like Allegro (like I said my mind is stuck on Allegro).

Thanks though.  I'll post back here if I have any more questions.

Pages: 1 2 [3] 4