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

Pages: [1]
1
DotNet / WinForms Events
« on: May 01, 2013, 01:56:04 am »
What control works best for binding SFML to? Are there any custom controls for it? Many eat events that SFML should have access to. Panels and PictureBoxes don't allow mouse wheel events.

2
Graphics / VertexArray Rendering Issues
« on: November 23, 2012, 04:12:16 am »
I recently made a tile map renderer using VertexArrays and noticed that it does not work as expected with an odd window height. Here are some screenshots showing what is happening:

800x600 window: http://i.imgur.com/tcBhK.png
800x601 window: http://i.imgur.com/tYSQS.png

I am using one texture for all tiles so the white you see is from the row below it. I am using SFML.NET.

Code can be found here: https://github.com/Rohansi/Californium/blob/master/Californium/TileMap.cs

Anyone know how I can fix this?


3
Audio / Playback Device
« on: November 04, 2011, 06:59:13 am »
How do you enumerate and select a playback device with SFML? Is there included functionality or is there something I need to do.

4
Network / GetLocalAddress
« on: March 07, 2011, 10:17:17 pm »
Whenever I call GetLocalAddress, I get the localhost IP (127.0.0.1), is this normal? :)

5
Graphics / SFML2 Shaders
« on: February 12, 2011, 11:03:59 pm »
I'm trying to figure out how to make some shaders, does anybody know some good resources (reference card, maybe)?

I'm using an Intel G41 (GMA X4500), don't give me anything too new. :)

So far all I have working is this:
Code: [Select]
void main()
{
gl_FragColor = vec4(1.0, 0.0, 0.0, 1.0);
}


Edit: Oh yeah, SFML2 from today.

6
Audio / SoundStream repeating
« on: December 31, 2010, 07:38:59 am »
I'm playing around with SoundStreams and I can't seem to get this to stop repeating samples.

Here's my code right now (it's not a lot!): http://dl.dropbox.com/u/675786/SoundTest.zip

7
Audio / sf::Sound destructor crash
« on: November 07, 2010, 09:04:44 am »
I've been getting this issue with sf::Sound with my outdated SFML2 and just updated it, but I still have the problem. I don't know why it's happening but it sure is a problem.

Whenever I use sf::Sound (I haven't checked others) the program always crashes when it is released from memory: http://i.imgur.com/V3kia.png However, sometimes if given some time, it will just leave a thread running and keep the program open.

Here's the code I'm using:
Code: [Select]
#include <iostream>
#include <SFML/Audio.hpp>

int main()
{
sf::SoundBuffer sb;

if (!sb.LoadFromFile("piano3.ogg"))
return 0;

sf::Sound snd(sb);
snd.Play();

while (snd.GetStatus() == sf::Sound::Playing)
sf::Sleep(0.01f);

return 0;
}


Although just this would replicate the problem:
Code: [Select]
#include <iostream>
#include <SFML/Audio.hpp>

int main()
{
sf::Sound snd;
snd.GetStatus(); // don't let it optimize out!
return 0;
}


I haven't done much with audio so I don't know if I'm doing anything wrong.

8
General / Building SFML2
« on: November 07, 2010, 03:55:41 am »
Where on Earth did that build directory for SFML2 go? I need it to build with VC++!

9
Window / Numberpad
« on: September 10, 2010, 01:17:18 am »
Does anybody know the keycode for the numpad decimal/delete? I can't find it, and would love to have it.

10
General / Runtime Errors
« on: April 18, 2010, 07:49:55 pm »
I'm getting one of two runtime errors (maybe both if I allow it). I have two objects in my game engine, one draws the FPS and the other an image.

When I use the FPS object I now get this error:

Quote
HEAP[Game Engine.exe]: HEAP: Free Heap block d65750 modified at d6586c after it was freed


When I use the image object I get this error:
Quote
An internal OpenGL call failed in image.cpp (828) : GL_INVALID_OERATION, the specified operation is not allowed in the current sate


I'm using SFML2 compiled statically. I don't know what's causing these...

11
Audio / Basic VoIP Problems
« on: February 02, 2010, 02:35:10 am »
I don't exactly know what's wrong with this, but it doesn't play any sound. I'm fairly certain it should play something, since it outputs stuff that doesn't seem totally constant. Can anybody point me in the right direction? Using latest SFML snapshot in Visual Studio 2008. Static linking.

This is my third attempt, all ended up like this.

Server
Code: [Select]
int main(int argc, char* argv[])
{
CanNet::TCPSocket server;
CanNet::TCPSocket* client = NULL;
CanNet::Buffer buff;
sf::SoundBuffer sndBuffer;
sf::Sound sndPlay(sndBuffer);
short buffer[8000];
bool connected = false;

CanNet::Startup();

server.Listen("1337");

FILE* fOut = fopen("received.dat", "w");

while (1)
{
if (!connected)
{
// Wait for connections
client = server.Accept();

if (client != NULL)
{
std::cout << "Client Connected!" << std::endl;
connected = true;
}
} else {
int size = client->Receive(buff);

if (size > 0)
{
sndPlay.Stop();
buff.Read(&buffer, size);
fwrite(&buffer, size, 1, fOut);
sndBuffer.LoadFromSamples(&buffer[0], size / 2, 1, 8000);
sndPlay.Play();
}
}

Sleep(1);
}

fclose(fOut);

server.Close();

CanNet::Shutdown();
return 0;
}

Client
Code: [Select]
int main(int argc, char* argv[])
{
CanNet::TCPSocket sock;
CanNet::Buffer buff;
sf::SoundBufferRecorder sndRec;
sf::SoundBuffer sndBuffer = sndRec.GetBuffer();

CanNet::Startup();

if (!sock.Connect("127.0.0.1", "1337"))
{
sock.Close();
std::cout << "Unable to connect." << std::endl;
CanNet::Shutdown();
return 0;
}

sndRec.Start(8000);

while (1)
{
if (!sock.IsConnected())
{
std::cout << "Lost connection." << std::endl;
break;
}

// Do shit.

Sleep(16); // ~60fps.

sndRec.Stop();

sndBuffer = sndRec.GetBuffer();

buff.Clear();
buff.Write((void*)sndBuffer.GetSamples(), sndBuffer.GetSamplesCount() * 2); // 1 sample = 2 bytes
sock.Send(buff);

sndRec.Start(8000);
}

sndRec.Stop();
sock.Close();

CanNet::Shutdown();

return 0;
}


Custom made networking system. I also have
Code: [Select]
An internal OpenAL call failed in soundbuffer.cpp (308) : AL_INVALID_VALUE, a numeric argument is out of range in the server.

12
Graphics / Font blurry?
« on: December 10, 2009, 10:45:43 pm »
When I draw some text, it comes out blurry...

I'd really like to know what's causing this.

Just in case...
Windows XP SP3 Home 32-bit
Intel Pentium 4 1.70GHz
512MB of RAM
Intel 82845G/GL/GE/PE/GV Graphics (64MB)

SFML 1.5 in MSVC++ 2008

Pages: [1]
anything