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

Pages: 1 2 [3] 4 5
31
Graphics / How do I display a variable?
« on: June 28, 2011, 09:01:59 pm »
Sorry, my mistake. How embarassing - I linked to the documentation and I hadn't even read it properly  :oops:

32
Window / Event sample rate
« on: June 28, 2011, 08:55:21 pm »
There is no need to use goto to jump out of your loop. Just call
Code: [Select]
sf::Window::Close(),
Code: [Select]
sf::Window::IsOpened() will stop returning
Code: [Select]
true and execution will leave your loop naturally.

As for your program not doing what it's supposed to, perhaps you should use real time inputs if you want to process mouse movement without getting held up by the event queue.

http://sfml-dev.org/tutorials/1.6/window-events.php
(The section entitled "Real Time Inputs")

PS: I notice you are using SFML 1.6. You should upgrade to 2.0 ;) Note that sf::Window::GetEvent has been renamed to sf::Window::PollEvent.

33
Graphics / How do I display a variable?
« on: June 28, 2011, 08:46:59 pm »
Just a note: to 'clear' the stringstream buffer, just do this:
Code: [Select]

std::ostringstream oss;
// etc
oss.str("");


Quote
changing str() to string()

Hmmm. That seems odd. What compiler are you using?
http://cplusplus.com/reference/iostream/ostringstream/str/

34
General / SFML with CodeBlocks problem
« on: June 28, 2011, 08:22:30 am »
This error:
Quote
The program can't start because sfml-system.dll is missing from your computer. Try reinstalling the program to fix this problem.

is because the SFML DLLs have to be in your project directory :)

(There is somewhere else you can put them, but that's never worked for me)

EDIT: As for PATH, go to Start and right click Computer. Click Advanced System Settings on the left, then in the resultant window click Environment Variables. Finally, in the bottom pane, scroll down until you see an entry named Path and double click it. In the resultant window, scroll to the end of the entry, make sure there is a semicolon after the previous path and then add your Code::Blocks installation directory (don't put it in quotes).

35
Graphics / SFML Default Font is Working
« on: June 27, 2011, 06:02:32 pm »
Peculiar title, I know ;)

Anyway, I was trying to reproduce some of the SFML font errors so I could point them out in the Fonts & Texts tutorial I am making. However, I was unable to do so.

Linking to static/dynamic and debug/release, the following code worked:
Code: [Select]

#include <SFML/Graphics.hpp>

int main()
{
sf::Text text("Hobo!");
sf::RenderWindow Window(sf::VideoMode(800, 600, 32), "Hello World!");

while (Window.IsOpened())
{
sf::Event Event;
while (Window.PollEvent(Event))
{
switch (Event.Type)
{
case sf::Event::Closed:
Window.Close();
break;
default:
break;
}
}

Window.Clear();
Window.Draw(text);
Window.Display();
}

return 0;
}


Are all the default font troubles and the related issues with dynamic linkage fixed now, or is this just an intermittent reprise?

36
Graphics / Problem with creating a renderwindow
« on: June 13, 2011, 07:01:44 pm »
@OP, On an unrelated note, if you like C++ and C# then (once you're happy with C++) you should try D. I have finally got round to trying it and it's quite nice - since it's quite easy to migrate between such similar langauges there's no harm in trying it, right? ;)

37
Graphics / Video Modes and Colour Depth
« on: June 13, 2011, 06:17:34 pm »
Thanks :D

38
Graphics / Video Modes and Colour Depth
« on: June 13, 2011, 05:58:27 pm »
So even in windowed mode, the bit depth is corrected to 8/16/32 or something?

39
Graphics / Problem with creating a renderwindow
« on: June 13, 2011, 04:56:27 pm »
Oh I see lol. Quincy is the name of an IDE which the author of that book wrote. I glanced at your path and assumed it was in Program Files, not Users :P

40
Graphics / Video Modes and Colour Depth
« on: June 13, 2011, 04:55:32 pm »
For a video tutorial I am making on windowing and video modes, I was wondering what happens when we give our video mode something like 11bit colour.

It is invalid for fullscreen mode, but what happens for windowed applications?

Also, to clarify, when a bad video mode is passed to the window constructor, does it revert to sf::VideoMode::GetDesktopMode()?

41
Graphics / Problem with creating a renderwindow
« on: June 13, 2011, 04:48:38 pm »
Quote
Also a small c++ question, I thought this :
Code:

sf::RenderWindow &GetWindow() {return RenderWindow;}


Would give a reference of the window and that I had to access its members with -> but it seems I have to do


In C++, a reference doesn't use the pointer to member operator '->', just the normal member operator '.'. That is for pointers. One of the advantages of references over pointers is the cleaner notation which results from this.

EDIT: I see you are using Quincy. Are you a fellow reader of Wiley's "Teach Yourself C++"?

42
SFML projects / SFSL - SFML File System Library
« on: June 13, 2011, 04:36:55 pm »
Quote
I hadn't really thought about it. Would there be any point?

Well when I was planning an archive manager, I considered putting it in just for the sake of it - after having waded into the largely undocumented LZMA SDK to compression, it would seem to make sense to go the whole way. Then I discovered all the export laws :/

Perhaps these reasons:
1) preventing users from easily cheating by editing game files (I guess it would also discourage modding...)
2) something like Valve's preloading whereby users could download the software in readiness for it's release, but it couldn't be run until then (this one is probably a fairly contrived reason though).

Quote
.zip is just the most common

But not as good compression ratio IIRC. Glad to hear it'll be extensible then :)

43
SFML projects / SFSL - SFML File System Library
« on: June 13, 2011, 01:02:17 pm »
Looks good - as Nexus said archive handling will be useful. Do you intend just to use zip, or might you use something like the LZMA SDK to support .7z files, etc as well?

Quote
Unicode filenames

Unicode friendliness! From you? Who'd have guessed ;) Seriously, though, it's a useful feature :)

I assume you won't be providing encrypted file handling, whether due to annoying laws on export or whatever...

44
General / Laggy / Slowness with hotkeys. / Multiple Hotkeys
« on: June 12, 2011, 09:08:54 am »
I don't think your real time input processing (with sf::Window::GetInput) should be inside the event loop.

EDIT: Only put event processing in there and nothing else as there are no benefits and the obvious disadvantage which you are experiencing.

45
Audio / Music Error
« on: June 11, 2011, 11:22:54 am »
Yeah it's a shame my walkman and Marantz CD player won't do OGG.

I am looking up Devo now :p

Pages: 1 2 [3] 4 5
anything