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

Pages: 1 [2] 3 4 ... 12
16
System / Re: String doesn't display accents under Linux
« on: March 12, 2013, 01:42:43 am »
Same behavior under win7 with MinGW. The wide string works, the ANSI one not  ::)
Thanks Laurent

17
System / String doesn't display accents under Linux
« on: March 11, 2013, 11:50:55 am »
Hi... I'm trying to display spanish strings with accents under Linux.. with no luck  :(

My GCC version is 4.7.2
Recent SFML 2.0 (compiled by me)
Linux Fedora 18 x64
Codelite IDE

Here is my minimal example:
#include <iostream>
#include <string>
#include <SFML/Graphics.hpp>

using std::cout;
using std::endl;


int main() {


    // Create the main window
    sf::RenderWindow window (sf::VideoMode (800, 600), "String Test");

    // Load font
    sf::Font myFont;
    if (!myFont.loadFromFile("./fuente.ttf")) {
        cout << "error loading font" << endl;
        return -1;
    }


        // Wide string
        const wchar_t *myStringW = L"wide string: áéíóú";
        cout << myStringW << endl;
       
        sf::Text myTextW (myStringW, myFont, 50);
        myTextW.setPosition(20, 100);

        // ANSI string
        const char *myANSIstring = "ANSI string: áéíóú";
        cout << myANSIstring << endl;
       
        sf::Text myANSItext (myANSIstring, myFont, 50);
        myANSItext.setPosition(20, 150);


    // Start the game loop
    while (window.isOpen()) {

        // Process events
        sf::Event event;
        while (window.pollEvent(event)) {

            // Close window : exit
            if (event.type == sf::Event::Closed)
                 window.close();
        }

        // Clear screen
        window.clear();

        // Draw
        window.draw(myTextW);
        window.draw(myANSItext);

        // Update the window
        window.display();

    }

    return EXIT_SUCCESS;

}
 

The wide string displays correctly using sf::Text. The ANSI string does not display accents.
Should I always use wide strings under Linux?


[attachment deleted by admin]

18
For static (or also dynamic) tiles (map) I suggest to use sf::VertexArray.

Exactly, use VA's for the tilemap to get the best performance
For the collision detection, one of the recommended data structures to use is a QuadTree.

19
General / Re: Can´t load Font files under Linux
« on: February 28, 2013, 12:38:30 am »
Problem solved

The font file extension was .TTF (uppercase)  :-[
I didn't notice until I run ls from the console..  :-[

Btw, the classic path format "./fonts/myfont.ttf" works fine  8)
No absolute path needed

Thanks!  ;)

21
Graphics / Re: error while loading sharelibraries libglew.so.1.7
« on: February 25, 2013, 10:28:16 pm »
Try reinstalling libglew from the official repository
Or, compile from sources  ;)

Quote
On Unix, typing make install will attempt to install GLEW into /usr/include/GL and /usr/lib. You can customize the installation target via the GLEW_DEST environment variable if you do not have write access to these directories.

22
General / (SOLVED) Can´t load Font files under Linux
« on: February 25, 2013, 10:07:22 pm »
Hi there!
I´m trying to get my game working under Fedora 18 x64
Im using C++ and SFML 2.0 from GitHub (very recent version)

I have created a folder where my font files are stored. Under win7, I load the files as usual:

if (!myFont.loadFromFile ("fonts//asd.ttf"))
// ...
 

And it works fine.
However, under Linux, this doesn´t work. The game compiles fine, but when I run it, I get this error message:

Failed to load font <filename>  (failed to create the font face)

The font files seems to work fine (I can open them from Dolphin, the KDE file explorer)

I tried changing the file path:
  • ./fonts//name.ttf
  • .//fonts//name.ttf
  • fonts//name.ttf

I can open (read and write) simple text files created by me using std::fstream. It works. Even files inside a folder (like "./config/engine.cfg")

Am I doing something wrong? Do I need to specify the full path to the files under Linux? SFML bug?
 :-\


EDIT:: Solved

23
SFML projects / Re: Simple Easy Particle Engine
« on: February 25, 2013, 09:22:32 pm »
Awesome!

You say you are using CircleShapes.. but can you use any other kind of Drawables too, like rectangles or Sprites?

Can´t wait to see the code!  ::)

24
General / Re: What IDE should I use?
« on: February 21, 2013, 07:05:04 pm »
Codelite has a very powerfull code completion system  8)

25
General / Re: "toon" style fade out ideas?
« on: February 14, 2013, 04:07:23 pm »
 ;D

26
General / Re: Trying to implement DeWITTER's game loop.
« on: February 14, 2013, 04:00:38 pm »
For a very little game, its ok

For a bigger proyect, specially if you have a physics engine, you need to implement this kind of game loop control

27
General / Re: "toon" style fade out ideas?
« on: February 12, 2013, 04:05:54 pm »
I thought of creating a huge black texture with a circular hole in its middle and zoom it out over the game screen but it seems to me that such a huge image...

You don´t need the full image, just 1/4...
rotate and draw this to get the full image  8)
 ;D

28
General / Re: Trying to implement DeWITTER's game loop.
« on: February 12, 2013, 03:56:08 pm »
Question..

Why not just use

App.setFramerateLimit(60);
 

Whats the difference between using that and implementing this?


Tally: by using setFramerateLimit, you are saying to your window: "Hey, dont draw more than x frames per second, please". With an implementation like this, you are not setting any limit on the FPS, you are just running the game (logic) at a fixed frame rate (in this case is 25 fps), and then using interpolation to smooth the animations.

I´m currently using the Fix Your Timestep! method.

29
SFML projects / Re: BichingISH! (Final Version 1.0)
« on: February 12, 2013, 03:10:40 pm »
1.0:
- some bugs fixed

30
SFML projects / Re: Exodus : SFML based windows Metroidvania game
« on: February 08, 2013, 04:39:48 pm »
Upvoted!  ;D
Your game looks beautifull, congratz!

How do you handle the boss animations? Several big texture files?

Pages: 1 [2] 3 4 ... 12