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

Pages: [1] 2
1
General discussions / Distributing an SFML app on Linux
« on: January 05, 2011, 02:57:45 pm »
Ahoy,
I am trying this for SFML but I guess it applies to linux apps in general.

I made a small game which I shared with other people on windows; the game only uses SFML and is almost entirely cross platform code.

On windows to distribute my apps I put the sfml DLLs in a subfolder called Lib/ and I then use the windows.h "SetDllDirectory" function to point to Lib/ and then load my own main DLL which contains all my code.

On linux, when a user wants to install my app should I place the SFML .so's in /usr/lib? or should I keep them in a subfolder? Should I move all the app's data to /usr/share/myapp?

I'm never too sure about the way linux works... Thanks again.

2
General discussions / Javascript SFML using WebGL?
« on: May 21, 2010, 11:28:02 pm »
With the recent developement of HTML5, I observed many websites that are now offering reasonable HTML5 demo content, or even nice applications.
I haven't managed to test any webgl stuff on my own computer :oops: but I've seen some in action.

Also, check out Google's pacman(probably only today though, 21st may)!

So... I wondered if it would be reasonable to eventually think about making a 2D library for WebGL, i.e., SFML for javascript.
I'm not enough into that field of programming to tell wether it would require a change in SFML's API organisation, my guess is that it probably would.

But hey, everyone can dream  8)

3
Graphics / Blurred font
« on: April 05, 2010, 05:52:46 pm »
Ay, Origins :lol: , I guess I need to read the doc with more attention next time...

Here:
Code: [Select]

#include <SFML/Graphics.hpp>
#include <iostream>
using namespace std;

int main(int argc,char** argv)
{

    sf::RenderWindow App(sf::VideoMode(800, 600, 32), "Client");

sf::Font font;
font.LoadFromFile("data/font.ttf",13);

sf::Sprite s;
const sf::Image* img = &font.GetImage();
((sf::Image*)img)->SetSmooth(false);
s.SetImage(*img);
s.SetPosition(100,100);

sf::String str("Hello World!",font,13);
    while (App.IsOpened())
    {
        sf::Event Event;
        while (App.GetEvent(Event))
        {
            if (Event.Type == sf::Event::Closed)
                App.Close();
            if (Event.Type == sf::Event::KeyPressed){
                if (Event.Key.Code == sf::Key::Escape){
                    App.Close();
                }
            }
        }

        App.Clear(sf::Color(0,0,0));
        App.Draw(str);
App.Draw(s);

        App.Display();
    }
    return EXIT_SUCCESS;
}

I also tried the same code but with 2.0 fixes to classes and names, same result.
font.ttf is Windows/Fonts/times.ttf by the way.

4
Graphics / Blurred font
« on: April 05, 2010, 05:32:31 pm »
I successfully compiled the latest revision of sfml2, and I wondered, are all centers gone? They were extremely useful to me in my code since I used the center of the image as the point where all of my sprites touched the isometric floor...

So, I commented out everything about centers, changed to sf::Text instead of sf::String, SetString instead of SetText, and yet...  text is still blurry.

 :cry:

5
Graphics / Blurred font
« on: April 05, 2010, 05:02:27 am »
Hello,

I've had a problem with fonts since I started using SFML: they are somehow blurred.
I've looked into the sf::String code, and briefly into the FontLoader code.
One thing I've noticed, with this minimal code, is that the rendered font image is kind of blurry:
Code: [Select]

font13.LoadFromFile("data/times.ttf",13);
sf::Sprite s;
const sf::Image* img = font13.GetImage();
((sf::Image*)img)->SetSmooth(false);//without that its worse...
s.SetImage(*img);
s.SetPosition(100,100);
App.Draw(s);


I'm using 1.5, should I consider going to 1.6 or 2.0? Or is it something I can fix?

Thanks, and here's an image:

6
Network / Bug with char/unsigned char?
« on: March 12, 2010, 12:52:20 am »
Hello,
I've just stumbled upon a really weird thing, it's either a bug or a misunderstanding from me.

If I put << an sf::Uint8 into a packet, and then >> it out by using a char instead, not only will it not work, but it will affect the rest of the packet!
(I use v1.5 too, maybe I should switch?)

here is the minimal code:
Code: [Select]
sf::Packet p;
std::string s1 = "Hello!";
std::string s2;
int i1 = 1;
int i2 = 5;
int i3,i4;
        //DEFAULT_HEAD is an sf::Uint16 and NPC_DIALOG is a sf::Uint8
p<<DEFAULT_HEAD<<GEVENT_NPC_DIALOG<<i1<<i2<<s1;
unsigned short h;
        //change the type to Uint8 or unsigned char and it will change the output!
//sf::Uint8 t;
        char t;
p>>h>>t>>i3>>i4>>s1;
printf("%d %d %d %d %s\n",h,t,i3,i4,s1.c_str());

Output with char t:
Quote
35812 0 117440512 16777216

Output with uint8
Quote
35812 7 1 5 Hello!
(the proper output)

7
General discussions / Using Modified Code
« on: March 06, 2010, 11:14:52 pm »
Oy that's cool.

Thanks then.

8
General discussions / Using Modified Code
« on: March 06, 2010, 10:46:53 pm »
Hello, I'm currently making as a personal project a free online game and because of some of the limitations of some of SFML's classes, I just copy pasted some of the code(for example sf::String) and added features that are proper to my game.

In the sources, part of the "license" says:
Quote

 2. Altered source versions must be plainly marked as such,
    and must not be misrepresented as being the original software.

I really don't mind plainly marking that I modified SFML, but I'm pretty much the only one to read the sources of the game. I don't mind putting the logo of SFML in-game, in the menu or where-ever, but then how should I indicate its a modified version :P ?

Also, if it really doesn't matter, please tell me ;)

9
Graphics / ["resolved"]blurred sf::string?
« on: February 08, 2010, 03:20:01 pm »
Oh well, found it myself, I thought I had commented out a part of the code when I didnt.

I was using SetCenter with floats, at some point when the size of the string was an odd number(41), it's half was something(20) + .5, and that little .5 blurred the text away.

I thought that by default text wouldnt use float precision, how fool of me  :lol:

10
Graphics / ["resolved"]blurred sf::string?
« on: February 08, 2010, 12:27:24 am »
Hello,

I'm loading a font at the same size which I am drawing it, but it's still blurred like it is scaled from a larger font...

any thoughts?

edit(my bad):
Windows XP, SFML 1.5,
Code: [Select]

// loading the font
font13.LoadFromFile("data/font.ttf",13);
// using the font
m_string = new sf::String("",GuiMan.font13,13);
// drawing the font
App.Draw(*m_string);

my usage is quite normal... I only use SetText and SetPosition, the position being a float vector, and putting it to ints will only blur even more...
also, it doesnt happen with every string, it will happen with "ahoy" but not with "ahoyho", and it happens with different fonts.

11
Graphics / Set Smooth images outline
« on: February 02, 2010, 02:51:35 am »
Hello,
When using image.SetSmooth(true), a white halo is created around the image(when given float positions). I guess this is due to the opengl/scene/whatever background being white(gl_ambiant?).
Is there anyway to change this color? or even to set it to 0 alpha?

12
General / Is it possible to use SFML and Irrlicht?
« on: January 21, 2010, 12:13:44 am »
on Windows: Irrlicht probably does provide a way to get the correct HWND handles
http://www.sfml-dev.org/tutorials/1.2/graphics-win32.php

13
General / Setting repeat frequency and changing order of rot/scale?
« on: January 17, 2010, 10:50:51 pm »
Quote from: "Laurent"


No, it uses the OS settings.

Hmm, I'll search that way then.

Quote

Not possible, but I wonder if it would look nice. If you're doing an isometric game then you should probably draw your sprites directly as they will look in the game.

I planned to use it for text, and indeed I don't think it would look nice on normal images.
Do you think I could do it with OpenGL calls?

14
General / Dynamic KeyBinding via script?
« on: January 17, 2010, 10:47:53 pm »
The reverse should be done?

i.e. :

Code: [Select]

keys =
{
    "LeftKey" : "left"
    "Z" : "jump"
    //...
};

15
General / Setting repeat frequency and changing order of rot/scale?
« on: January 17, 2010, 10:43:37 pm »
Hello, I have two little questions,

first is it possible to change the repetition frequency of a key being held?
(the equivalent of SDL_EnableKeyRepeat(delay,interval) )

and second, I am trying to create an isometric effect on a Sprite, it is possible to do so by rotating clockwise by 45 degrees and then scaling the height by half. The problem is SFML seems to scale first and rotate after, which does not create the same effect.
Is there any way to change this or must I  do the transformations one by one on an Image(is that even possible?)

Thanks for your time!

Pages: [1] 2
anything