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

Pages: [1] 2
1
Graphics / SetFramerateLimit problem
« on: July 08, 2009, 10:26:19 pm »
Are you sure you don't have vertical sync enabled??
That leap from 60 to 30 fps is a bit suspect...

2
Graphics / Setting application icon
« on: July 08, 2009, 07:16:49 pm »
Well, I'd prefer to load the icon from the executable, but loading it from a file it's not a bad solution ;)

I've finally done what Hiura says, after converting the icon to a png file ;)

Thanks!

3
Graphics / Setting application icon
« on: July 08, 2009, 03:23:40 pm »
Hi all,

I'd like to set an image icon for my application. I'm using C++ on Visual Studio 2008.

I've seen that there's a SetIcon method that receive a pointer to the buffer of the image, but I really don't know how to use it since I've got a HICON:
Code: [Select]

sf::RenderWindow m_window;
HICON hIcon = (HICON) LoadImage(instance, MAKEINTRESOURCE(IDI_MYICON), IMAGE_ICON, 0, 0, LR_DEFAULTSIZE);

m_window.SetIcon(32, 32, ???);


Does anyone know how this can be done?

Thanks!

4
Audio / Crashing after "Failed to open the audio device".
« on: June 28, 2009, 07:36:44 pm »
Thanks, I'll try it and post back with the results ;)

5
Audio / Crashing after "Failed to open the audio device".
« on: June 28, 2009, 04:22:10 pm »
Hi Laurent,

I'm using Windows XP and Visual Studio 2008 (C++).

Hum..about how I installed OpenAL, I really don't remember exactly, since installed it  some months ago, but taking a look at the dll files I see that:
1) I've got libsndfile-1 and openal32.dll on the executable folder of my application (I just copied the files from the extlibs folder of SFML SDK). I followed thet Tutorial "Getting started - SFML and Visual Studio").

2) I've taken a look to the installed applications from "Add or remove applications" of Control Panel and I see that there's also installed OpenAL....There's a openal32.dll on c:\windows\system32 folder with a different size that the one located on my application folder...

Maybe the problem is there, although I don't know if dll files of my application folder are ignored...How should OpenAL be installed??

Thanks for your time.

6
Audio / Crashing after "Failed to open the audio device".
« on: June 28, 2009, 02:07:09 pm »
Hi all,

Sometimes I'm getting a "Failed to open the audio device" message on the console output when I run my application using SFML. After that message, the application crashes.

Source code lines of my app thatares using audio SFML commands are:
Code: [Select]

m_sound_buffer = new sf::SoundBuffer();
if(!m_sound_buffer->LoadFromFile(GetConfigFile()->GetDataPath() + "mig.ogg"))
{
  return;
}
m__sound = new sf::Sound(*m_sound_buffer, true);


Console output:
Failed to open the audio device
An internal OpenAL call failed in soundbuffer.cpp (46) : AL_INVALID_OPERATION, t
he specified operation is not allowed in the current state
An internal OpenAL call failed in soundbuffer.cpp (300) : AL_INVALID_OPERATION,
the specified operation is not allowed in the current state
An internal OpenAL call failed in sound.cpp (51) : AL_INVALID_OPERATION, the spe
cified operation is not allowed in the current state
An internal OpenAL call failed in sound.cpp (53) : AL_INVALID_OPERATION, the spe
cified operation is not allowed in the current state
An internal OpenAL call failed in sound.cpp (54) : AL_INVALID_OPERATION, the spe
cified operation is not allowed in the current state
An internal OpenAL call failed in sound.cpp (55) : AL_INVALID_OPERATION, the spe
cified operation is not allowed in the current state
An internal OpenAL call failed in sound.cpp (56) : AL_INVALID_OPERATION, the spe
cified operation is not allowed in the current state
An internal OpenAL call failed in sound.cpp (57) : AL_INVALID_OPERATION, the spe
cified operation is not allowed in the current state

Stack frame:
openal32.dll!00b8c5eb()
[Frames below may be incorrect and/or missing, no symbols loaded for openal32.dll]
openal32.dll!00b8ba5c()
kernel32.dll!7c80b729()

Error message:
Unhandled exception at 0x00b8c5eb in app.exe: 0xC0000005: Access violation reading location 0x00000000.

I guess that application crashes because it can't initalize the audio device, but my application doesn't realize of the error and then tries to load the .ogg file. How could I know if my audio device is initalized properly or not??

Thanks!

7
Graphics / SFML breaks, trying to free the default font
« on: June 15, 2009, 09:18:40 pm »
I'm happy to hear that is fixed on 2.0 branch :D
Meanwhile, I'll remove the Cleanup()  sentence from WindowImplWin32::ProcessEvent method.

Thanks Laurent ;)

8
Graphics / SFML breaks, trying to free the default font
« on: June 15, 2009, 08:51:44 pm »
Hi all,

It's happening the same to me..It crashes when the application finishes and SFML is freeing all resources (freeing the default font).

This minimal sample application crashes:

Code: [Select]

#include <SFML/System.hpp>
#include <SFML/Window.hpp>
#include <SFML/Graphics.hpp>
int main()
{
   sf::String text;
   return 0;
}



Call stack:
Code: [Select]

  atioglxx.dll!69029503()
  [Frames below may be incorrect and/or missing, no symbols loaded for atioglxx.dll]
  opengl32.dll!5f145709()
  opengl32.dll!5f139aad()
  opengl32.dll!5f139c5f()
> sfml-window-d.dll!sf::priv::WindowImplWin32::SetActive(bool Active=true)  Line 302 + 0x1c bytes C++
  sfml-window-d.dll!sf::Context::SetActive(bool Active=true)  Line 64 + 0x18 bytes C++
  sfml-graphics-d.dll!sf::priv::GraphicsContext::GraphicsContext()  Line 69 C++
  sfml-graphics-d.dll!sf::Image::DestroyTexture()  Line 776 + 0x8 bytes C++
  sfml-graphics-d.dll!sf::Image::~Image()  Line 117 C++
  sfml-graphics-d.dll!sf::Font::~Font()  + 0x63 bytes C++
  sfml-graphics-d.dll!`sf::Font::GetDefaultFont'::`2'::`dynamic atexit destructor for 'DefaultFont''()  + 0x28 bytes C++
  sfml-graphics-d.dll!_CRT_INIT(void * hDllHandle=0x007f0000, unsigned long dwReason=0, void * lpreserved=0x00000001)  Line 446 C
  sfml-graphics-d.dll!__DllMainCRTStartup(void * hDllHandle=0x007f0000, unsigned long dwReason=0, void * lpreserved=0x00000001)  Line 557 + 0x11 bytes C
  sfml-graphics-d.dll!_DllMainCRTStartup(void * hDllHandle=0x007f0000, unsigned long dwReason=0, void * lpreserved=0x00000001)  Line 507 + 0x11 bytes C
  ntdll.dll!7c91118a()
  ntdll.dll!7c933ada()
  ntdll.dll!7c920435()
  ntdll.dll!7c92043e()
  ntdll.dll!7c933c88()
  kernel32.dll!7c81cb26()
  msvcr90d.dll!__crtExitProcess(int status=0)  Line 732 C
  msvcr90d.dll!doexit(int code=0, int quick=0, int retcaller=0)  Line 644 + 0x9 bytes C
  msvcr90d.dll!exit(int code=0)  Line 412 + 0xd bytes C
  main.exe!__tmainCRTStartup()  Line 595 C
  main.exe!mainCRTStartup()  Line 399 C
  kernel32.dll!7c817077()
  main.exe!__CTA1?AVexception@std@@()  + 0x86bd bytes C++
  c7fff6b9()


My video card is an ATI Radeon 9550.

9
General discussions / Newb question about LGPL license
« on: June 03, 2009, 11:20:28 am »
Thanks to clear it up. Anyway, my concern was whether I was required to distribute the sources of the commercial project or not. I have no problem sharing any changes I make to library if this helps to the community :D

10
General discussions / Newb question about LGPL license
« on: June 03, 2009, 01:37:11 am »
Thanks for your answer.
I'll glady share the source. I hope my changes can be useful to anyone :D

11
Audio / SFML audio crashing on Vista
« on: June 03, 2009, 12:17:23 am »
Hi,

I'm developing a project using SFML on Windows Xp and it works great. But the same project on Vista has random crashes. I think that audio library has something to do with it, because the application only crashes when in the console ouput there is a "Failed to open the audio device" message.

The weird thing is that just after crashing I run the application again and the application doesn't crash (and it doesn't show the "Failed to open the audio device" message). So, how it's possible that sometimes the library can open the audio device and sometimes it can't?????

Thanks!

Edit: I've fixed the crash. I was mixing static and dynamic linking (I ignored some linking warnings) and that was making my app to crash :roll:

12
General discussions / Newb question about LGPL license
« on: June 02, 2009, 11:51:56 pm »
Hi all ;)

I also have a question about LGPL licence: I'm developing a commercial project that runs on a computer with wacom touchscreen, so I had to modify SFML to add touchscreen support. So now I need to share the source code of my commercial project????

Thanks!

13
Network / Troubles with bi-directional communication.
« on: May 15, 2009, 12:45:11 pm »
:lol:

Thanks!

14
Network / Troubles with bi-directional communication.
« on: May 14, 2009, 10:54:02 pm »
Oops, thanks  :D

When should I clear the packet? Just after sending each packet and just after copying the packet to the "e" variable (using operator >>)?

15
Network / Troubles with bi-directional communication.
« on: May 14, 2009, 06:12:49 pm »
Hi again ;)

Here I provide a complete and minimal sample code which demonstrates what is happening.

If you take a look at the sample code, the server should receive a SET_ISNEAR command, but is receiving a SET_BEGIN!

Code: [Select]

#include <iostream>
#include <sstream>
#include <SFML/Network.hpp>


struct UserEventPkt
{
sf::Uint32   Op;
sf::Uint32   Par1;
sf::Uint32   Par2;    
};

enum UserEvent
{
SET_POSITION,
SET_PRESSURE,
SET_ISNEAR,
SET_ISTRIGGERDOWN,
SET_BEGIN
};


sf::Packet& operator <<(sf::Packet& Packet, const UserEventPkt& C)
{
    return Packet << C.Op << C.Par1 << C.Par2;
}

sf::Packet& operator >>(sf::Packet& Packet, UserEventPkt& C)
{
    return Packet >> C.Op >> C.Par1 >> C.Par2;
}


int main()
{
sf::SelectorTCP Selector;
sf::SocketTCP Listener;
sf::Packet packet;
UserEventPkt e;
sf::SocketTCP Client;


// Client or server ?
  char Who;
  std::cout << "Do you want to be a server ('s') or a client ('c') ? ";
  std::cin  >> Who;
if (Who == 's')
  {
if(!Listener.Listen(4567))
{
printf("Can't listen");
exit(0);
}

Selector.Add(Listener);

while(true)
{
unsigned int NbSockets = Selector.Wait();

for(unsigned int i = 0; i < NbSockets; ++i)
{
sf::SocketTCP Socket = Selector.GetSocketReady(i);

if (Socket == Listener)
{
// If the listening socket is ready, it means that we can accept a new connection
sf::IPAddress Address;
Listener.Accept(Client, &Address);
std::cout << "Client connected ! (" << Address << ")" << std::endl;

// Add it to the selector
Selector.Add(Client);

e.Op = SET_BEGIN;
e.Par1 = 0;
e.Par2 = 0;

// Send INIT to Client
packet << e;
Client.Send(packet);
}
else
{
// Else, it is a client socket so we can read the data he sent
sf::Packet Packet;
if (Socket.Receive(Packet) == sf::Socket::Done)
{
UserEventPkt e;

Packet >> e;

switch(e.Op)
{
case SET_POSITION:
printf("Set Position from Client");
break;

case SET_PRESSURE:
printf("Set Pressure from Client");
break;

case SET_ISNEAR:
printf("Set IsNear from Client");
break;

case SET_ISTRIGGERDOWN:
printf("Set IsTriggerDown from Client");
break;

case SET_BEGIN:
printf("Set Begin from Client");
break;

default:
std::cout << "A client says : " << e.Op << "(" << e.Par1 << "," << e.Par2 <<  ")" << std::endl;
}
}
else
{
// Error : we'd better remove the socket from the selector
Selector.Remove(Socket);
}
}        
}
}
}
else // Client
{
if (Client.Connect(4567, "127.0.0.1") != sf::Socket::Done)
{
std::cout << "Client can't connect to server" << std::endl;
exit(0);
}

while(true)
{
if (Client.Receive(packet) == sf::Socket::Done)
{
packet >> e;
if(e.Op == SET_BEGIN)
{
printf("SET BEGIN received!");
}
}
e.Op = SET_ISNEAR;
e.Par1 = 0;
e.Par2 = 0;
packet << e;
Client.Send(packet);
}
}
}

Pages: [1] 2
anything