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

Pages: 1 2 [3]
31
SFML projects / BF::Renderer::Text
« on: November 26, 2007, 02:28:05 pm »
Quote from: "Lord Delvin"

@acrin: I'd like to see a bitmap font, as this would enable us to use even 8px high fonts,

There is a screenshot here and the font happens to be 8px:

http://acrin1.blogspot.com/

Not much text displayed here unfortunately.

32
Window / Reading key presses into a String
« on: November 26, 2007, 02:21:50 pm »
Quote from: "Laurent"
You can use a code equivalent to the SDL one you're showing (which is the right way of doing it), with the TextEntered event.

Code: [Select]
if ( event.Type == sf::Event::TextEntered )
{
    if ( event.Text.Unicode < 0x80 ) // it's printable
    {
        keyString = (char)event.Text.Unicode;
    }
}


That's great - I'll give it a try.

Thanks.

33
SFML projects / BF::Renderer::Text
« on: November 25, 2007, 04:26:59 pm »
Those samples look good. I'd certainly be interested in it as I was wanting to use small font sizes myself. I ended up just using a fixed size bitmap font in the end.

Thanks.

34
Window / Reading key presses into a String
« on: November 25, 2007, 04:09:59 pm »
Hi,

I'm wanting to read in single key presses, do some error / special key checking and add the valid key presses to a c++ string. The string would be a mixture of upper and lower case letters and other symbols. Is there a simple way to do this rather than me having to check explicitly for every unique key like so?

if ((Event.Type == sf::Event::KeyPressed) && (Event.Key.Code == sf::Key::L)) myString = myString+"L"

I've looked in the documentation but it wasn't obvious to me how to do this.

In SDL I've been able to do the following in the past:

if ( event.type == SDL_KEYDOWN )
{
 if (( event.key.keysym.unicode < 0x80 ) &&
( event.key.keysym.unicode > 0 )) // it's printable
{
 keyString = (char)event.key.keysym.unicode, 1;
   
I also noticed that only there only seem to be lower case letters defined currently. Does this mean I can't differentiate between upper and lower case input?

Thanks.

35
General discussions / Re: Less formats vs less dependencies ?
« on: October 31, 2007, 02:18:17 pm »
I'd be fine with less file formats. I really only use PNG and BMP. The fewer DLLs or additional files that need to be shipped with an SFML application or game, the better.

36
Window / Reading single key presses
« on: October 22, 2007, 08:58:14 pm »
Quote from: "Laurent"
sf::Input is for reading real-time (continuous) inputs. It shouldn't be used to get single events like key presses.

Use the sf::Event::KeyPressed event instead.

Thanks. I missed that in the tutorial.

37
Window / Reading single key presses
« on: October 21, 2007, 11:01:22 am »
I'm reading the keyboard like so:

if (App.GetInput().IsKeyDown(sf::Key::F11)) ToggleInsMode();
if (App.GetInput().IsKeyDown(sf::Key::F10)) ToggleItemMode();

This is working ok but this method is reading the key continuously until the key is released. What's the best way to read a single keypress or turn off the continuous reading of keys?

Thanks

38
SFML projects / Demon's Eye
« on: October 13, 2007, 06:35:51 pm »
Hi,

I've been a big fan of the old tile based style RPGs for a number of years and finally decided to have a go at creating one myself using SFML.  So far I've just started working on a map editor so the design is still at a very early stage and many things are likely to change over the coming months. There are screenshots and a record of my efforts to date here:

http://acrin1.blogspot.com/

So far using SFML has been a very pleasant experience. I've been surprised by how few SFML problems I've actually had. Hopefully in the next month or two I might have an early demo version available. Any feedback or suggestions welcome in the meantime.

39
Window / Disabling anti-aliasing
« on: September 19, 2007, 11:22:41 pm »
Quote from: "Laurent"
Antialiasing is turned off by default.

I can see two reasons why your sprites look smooth :

- Antialiasing is forced in your driver's control panel (you should select "let the application choose")
- It's because of the texture filtering ; using Image::SetSmooth can disable it

I think it's the second one, as antialiasing only affects primitive edges. In fact it won't make any difference unless you use 3D (OpenGL) code.


That's great - your second suggestion solved it:

sf::Image BackgroundImage;
    if (!BackgroundImage.LoadFromFile("images/terrain_tiles.png"))
        return EXIT_FAILURE;
   BackgroundImage.SetSmooth(false);
    sf::Sprite Background(BackgroundImage);

Thanks for your quick response.

40
Window / Disabling anti-aliasing
« on: September 19, 2007, 08:22:25 pm »
Hi,

I've noticed that by default anti-aliasing seems to be turned on. I looked in the documentation and thought that setting the renderwindow aliasing value to 0 would disable it.

sf::RenderWindow App(sf::VideoMode(800, 600), "RPG", sf::Window::Fixed, 0 );

Am I misreading the documentation? The reason I'm asking is because I'm using small tiles (32x32) and they look better without any smoothing.

Thanks

41
General discussions / this looks interesting
« on: September 16, 2007, 04:04:34 pm »
Quote from: "dabo"
I just found out about SFML this morning, and so far everything is fantastic. I was about to start my first game projekt using SDL but now when I have found SFML, SDL is out of the picture.

The documentation and tutorials are great too.


I've been really impressed with SFML. I'm planning to port my existing SDL project to SFML and start a new SFML project soon. The people on the forum are very helpful too.

42
Graphics / OpenGL and SFML Graphics in a single window
« on: August 30, 2007, 03:44:06 pm »
Quote from: "Laurent"
Yes, have a look at the OpenGL sample, it does exactly what you want.


Thanks. That's great. I'd been looking at the OpenGL tutorial rather than the sample progrem.

My current SDL/OpenGL project has the 2D stuff done with OpenGL which I find less convenient. This will make things a lot easier for me.

thanks again.

43
Graphics / OpenGL and SFML Graphics in a single window
« on: August 30, 2007, 02:03:06 pm »
Hi,

Apologies if this is a silly question. Is is possible to draw an OpenGL 3D view in an SFML window but use SMFLs 2D graphics functions in the same window? E.g. for displaying text or overlaying sprites.

Thanks

44
Graphics / Font Tutorial Problems
« on: August 29, 2007, 03:13:44 pm »
Quote

Make sure you link with the debug libraries in debug mode (sfml-graphics-d.lib, and so on).


Thanks for the quick response. Linking with the debug libraries seems to have resolved the problems I was having.

I'm not really sure I appreciate the differences between the static/dynamic and release/debug libraries. It might be useful to some people if you could expand some of the documentation for these at some time in the future.

Thanks

45
Graphics / Font Tutorial Problems
« on: August 28, 2007, 03:12:17 pm »
Hi,

I'm really interested in SFML but I've been having some problems getting some of the tutorials to work. I'm using Visual Studio 2005 Professional. For example with the font tutorial I've a few questions.

What libraries should I be specifying in the Linker/Input settings and in what order?
Does the arial.ttf file need to be in the same folder as the .exe?

I can get the program to compile ok but it won't run - see below.

--

1>------ Rebuild All started: Project: sftest2, Configuration: Debug Win32 ------
1>Deleting intermediate and output files for project 'sftest2', configuration 'Debug|Win32'
1>Compiling...
1>main.cpp
1>Compiling manifest to resources...
1>Linking...
1>sfml-graphics.lib(RenderWindow.obj) : MSIL .netmodule or module compiled with /GL found; restarting link with /LTCG; add /LTCG to the link command line to improve linker performance
1>LINK : warning LNK4075: ignoring '/INCREMENTAL' due to '/LTCG' specification
1>LINK : warning LNK4098: defaultlib 'MSVCRT' conflicts with use of other libs; use /NODEFAULTLIB:library
1>Generating code
1>Finished generating code
1>Embedding manifest...
1>sfml-graphics.lib(RenderWindow.obj) : MSIL .netmodule or module compiled with /GL found; restarting link with /LTCG; add /LTCG to the link command line to improve linker performance
1>LINK : warning LNK4075: ignoring '/INCREMENTAL' due to '/LTCG' specification
1>LINK : warning LNK4098: defaultlib 'MSVCRT' conflicts with use of other libs; use /NODEFAULTLIB:library
1>Generating code
1>Finished generating code
1>Build log was saved at "file://c:\Files\sftest2\sftest2\sftest2\Debug\BuildLog.htm"
1>sftest2 - 0 error(s), 4 warning(s)
========== Rebuild All: 1 succeeded, 0 failed, 0 skipped ==========


Are these warnings anything to worry about?

If I try to run the compiled program without debugging I get a sftest.exe failed to run / encountered an error style Windows message.

If I run it in debug mode I get an unhandled exception and memcpy.asm appears along with call stack information.

Unhandled exception at 0x10232014 (msvcr80d.dll) in sftest2.exe: 0xC0000005: Access violation writing location 0xcccccc00.

Sorry for all the questions but I'm not that familiar with VS2005 either but I seem to be able to use it with SDL/OpenGL without any major problems and I'm keen to try SFML properly.

Thanks.

Pages: 1 2 [3]
anything