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

Pages: [1]
1
Graphics / Help specifying a custom charset
« on: April 27, 2011, 07:53:21 am »
I downloaded this font from dafont and it was a .fon so I used fontforge to convert it to a .fnt so I could use it with SFML. According to fontforge, it uses the ascii characters from 32-255, but when I run the game the console prints out 'Failed to load font "Pokemon-11.fnt" (invalid charmap handle)'

This is my code:
Code: [Select]
Uint32 chars[] = {32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, 255};
Font font;
font.LoadFromFile("Pokemon-11.fnt", 11u, chars);
String test("Blah.", font, 16.f);
I made a little mini program to print out the line with all the numbers for me, so I'm pretty sure the numbers are right.

2
Graphics / Loading an image from a .rc file
« on: January 27, 2011, 03:26:45 am »
I'm trying to upgrade my screensaver from using Shapes to using actual images. I have it working and everything, but I was wondering if there was a way to set an sf::Image from an image saved in a .rc file, that way my screensaver's just one file.

3
Window / [VS2010] How do you get rid of the console window?
« on: January 27, 2011, 01:08:40 am »
I've successfully made a screen saver with VS2010. It works great, but when it opens the console appears just before the RenderWindow does, and it closes just after the RenderWindow. I want to get rid of that console window.

I've tried going into the project's properties and changing Configuration Properties -> Linker -> System -> SubSystem to Windows. However, when I tell it to compile I get this error in the file MSVCRT.lib(crtexew.obj)
Quote from: "Visual Studio 2010"
error LNK2001: unresolved external symbol _WinMain@16

4
Window / Screen Savers and Event::MouseMoved
« on: January 26, 2011, 02:42:50 am »
I'm trying to make a simple Windows screen saver. My only issue is closing it when the mouse moves. This is my code:
Code: [Select]
case Event::MouseMoved:
app.Close();
break;
The problem is that this closes the window as soon as it opens. Is there any way to fix this?

5
Window / App crashed on Window::Close()
« on: December 21, 2010, 08:44:25 pm »
I just started with SFML 1.6 and I'm trying to go through the official tutorials. I'm currently on the window-events one. I'm using Visual Studio 2010, and my problem is that my program crashes when it's told to close. VS gives me the error:
Quote from: "Visual Studio"
Run-Time Check Failure #2 - Stack around the variable 'app' was corrupted.
This is my code:
Code: [Select]
int main(int argc, char** argv)
{
Window app(VideoMode(768, 512, 32), "SFML Window");
const Input& input = app.GetInput();

while (app.IsOpened())
{
Event events;
while (app.GetEvent(events))
{
if ((events.Type == Event::Closed) || // X is clicked
((events.Type == Event::KeyReleased) && (events.Key.Code == Key::Escape))) // Esc is released
app.Close();
}

// Arrow Keys
bool LeftKeyDown = input.IsKeyDown(Key::Left);
bool RightKeyDown = input.IsKeyDown(Key::Right);
bool UpKeyDown = input.IsKeyDown(Key::Up);
bool DownKeyDown = input.IsKeyDown(Key::Down);
// Mouse
bool LeftDown = input.IsMouseButtonDown(Mouse::Left);
bool MiddleDown = input.IsMouseButtonDown(Mouse::Middle);
bool RightDown = input.IsMouseButtonDown(Mouse::Right);
unsigned int MouseX = input.GetMouseX();
unsigned int MouseY = input.GetMouseY();

app.Display();
}
return 0;
}

Pages: [1]