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

Pages: [1]
Feature requests / Vertex Shader
« on: August 30, 2010, 06:56:49 pm »
Hi Laurent
Why don't you allow to set the VertexShaderSrc? This is quite useful even for normal sprites in a deferred rendering approach. And as far as i can see the changes are minimal (adding a second parameter to LoadFromFile).
Am i missing something?
I did add a member char* vertexShaderSrc to the sf::Shader that is used instead of vertexSrc if it is non-null...
greetz TGM

Network / Packet.SetReadPos()
« on: June 16, 2008, 10:37:15 pm »
would you mind adding something like

That would certainly make some things easier ... (and it doesnt require more than 5 lines of code.)
thx in advance

SFML projects / DefensCommander - A game in 3h
« on: May 23, 2008, 12:05:06 pm »
Well, a friend of mine and me were bored yesterday, so we tried to create a game in 3hours. The result is a arcade klon...
I don't know the original name of this game, so if someone knows the name, please tell me ;)
The game principle is quite easy... you got three "citys" each armed with 5 rockets. each level there are 20 incoming missiles, that do try to hit your "citys" your task ist to shoot the enemy missiles down. The game cannot be won, each level gets faster...
Here are 2 screenshots:

Download: (source + linux 32 bin)
sry.. I know RS suxx
C&C welcome...

Feature requests / Image GL_REPEAT
« on: May 01, 2008, 01:01:08 pm »
I would like to see something like Image -> SetRepeat(true);
Or to be more precise control over the WRAP of a texture
Well , Iknow this was in v. 1.2
But somehow it isn't in the current release...
Could we get this back, or are there any internal problems with this one?
thx tgm

SFML projects / TGMs small patches
« on: April 29, 2008, 06:26:47 pm »
Well, this is no actual project... anyway.. this is the placer, where I'm going to release small additions etc for SFML.. I would love to see them in the SVN ;) everything I gonna post within this thread can be used without any license.. (and of course without any warranty ;) )
bla bla.. lets get started ^^

Feature requests / selectors socket identification.
« on: April 25, 2008, 11:47:02 am »
Is there a way to identify a socket, that is returned by the Selector.GetSocketReady(int i) (as in the current SVN...)
I would like to use the selector in a server.. now the server must know from which Client he got the package (IP is not enought, since there might be more than one client per IP)
one possibility would be to have a seconde array of sockets  and then using == for testing.. but the better one would be to have a unique SocketID or something for each socket in the selector..
Any chance you would add something like this to the selector class? (I even would do the little bit of coding^^

General discussions / Addition for Font
« on: April 23, 2008, 08:39:21 pm »
A friend of mine+Me are currently building a GUI for SFML.
Doing editfields with mouse support is quite hard without access to the fonts character dimensions. So i did add a member to Font, that will return a Vector containing the size of a given character with a given style and a given scale. Since I got no SVN access I gonna post the patch in here..
(hoping it will be used in the SVN version)

Code: [Select]

#include <SFML/System/Vector2.hpp>
//.. Rest of the code here


    /// gets the size of a given character if renderet with this font


    /// \param c : The character, whose size should be returned

    /// \param s : The style of the character (default: Regular)

    /// \param scale : Scale of the string (default: 1)


    /// \return the Vector2f containing the size of the character


Vector2f  GetCharSize(wchar_t c, int s=0, float scale=1);
Vector2f  GetCharSize(char c, int s=0, float scale=1);

Code: [Select]


/// Gets the Vector2f containing the size of a single Character

Vector2f  Font::GetCharSize(wchar_t c, int s, float scale)
float Factor    = scale / myCharSize;
Vector2f  retValue(0,0);

std::map<wchar_t, Font::Character>::const_iterator It = myCharacters.find(c);

if (It == myCharacters.end())


return (retValue);


const Character& CurChar = It->second;

const IntRect& Rect = CurChar.Rect;

float Advance = CurChar.Advance * Factor;
// use Advance as size.y of the character

retValue.x += Advance;

// get size.x for  this character

float CharHeight = (myCharSize + Rect.Bottom) * Factor;

retValue.y = CharHeight;

if (s & 1)


        retValue.x  += 1 * Factor;

        retValue.y += 1 * Factor;


    // Add a slight width if we're using the italic style

    if (s & 2)


        retValue.x += 0.208f * scale;


    // Add a slight height if we're using the underlined style

    if (s & 4)


        if (retValue.y < scale + 4 * Factor)

            retValue.y += 4 * Factor;

    return retValue;


/// Gets the Vector2f containing the size of a single Character

Vector2f  Font::GetCharSize(char c, int s, float scale)
return GetCharSize((wchar_t)(c),s,scale);

int s is the style of the string, int scale, the scale of the String and c a single character  :lol:
greetz TGM

*edit* one small error in there..
Code: [Select]
Vector2f  Font::GetCharSize(char c, int s, float scale)
return GetCharSize((char)(c),s,scale);

has to be
Code: [Select]

Vector2f  Font::GetCharSize(char c, int s, float scale)
return GetCharSize((wchar_t)(c),s,scale);

Feature requests / Recreating the projektion matrix onwindow rescale
« on: April 20, 2008, 06:35:58 pm »
I would be interested if there would be a way to proper recreate the projektion matrix on rescaling of the window.. (or this being done automaticly)
So Sprites wouldn't be distorted after rescaling the window, but instead some part of the world simply lay outside the screen.
something like(from :http://www.lighthouse3d.com/opengl/glut/index.php?3):
Code: [Select]

void changeSize(int w, int h) {

// Prevent a divide by zero, when window is too short
// (you cant make a window of zero width).
if(h == 0)
h = 1;

float ratio = 1.0* w / h;

// Reset the coordinate system before modifying

// Set the viewport to be the entire window
glViewport(0, 0, w, h);

// Set the correct perspective.

Well, of course you don't use glut, do you? Gonna have a look in the source.. Well, doesn't seems like you do ;) But I guess this code shows pretty well, what I want to say^^

Network / stupid question about sending/receiving at the same time.
« on: April 11, 2008, 06:58:17 pm »
I know this might sound very retarded, but I tried finding some good tutorials and they always end, before questions as this arise.
I would like to have a 2client 1server system.
Now the server sends packages from one client to another.
Now I would like to be able to send stuff from one client, while I'm still listening for incoming packages.
Well, one could argue "why should you care.. just finish sending and then read what has come inbetween" but unfortunably single packages will melt together to a single big one if I try it this way..
So I tried using two threads one always listening, another the one who has to send the stuff.. (should work- thats what duplex is for, isn't it? besides I'm just using the loopback...) well, it won't work.. somehow, the server complains that the connection was ended / Client.Receive returns with !=sf::Socket::Done. (I just tested having a second thread besides the mainthread that will send stuff)
Any suggestions what to do? Is there a better way doing this, maybe using two ports?? (sounds VERY dump to me..) or is there anything I have to take care of if I want to use one port together with two threads thread?? maybe having a mutex on the send(), so that send() cannot be interupted?? Maybe some links to some more advanced tutorials?
thx in advance.. tgm

*edit* Well, one could prevent the"melting" with sending a size information in the beginning of an package..
the best solution would be a possibility to fast check wether there is any input in the input buffer, or not..

Feature requests / italic and bold for sf::String
« on: April 10, 2008, 07:39:37 pm »
It would be pretty cool, if there would be the possibility of making a String bold/italic.
greetz TGM

Feature requests / Plattform independet File Open / File Save dialogs
« on: March 28, 2008, 06:27:22 pm »
As the titel says, I would love to have platform independent file open / save dialogs.. Any chance??

General / current SVN version: samples Socket Build Problem
« on: March 04, 2008, 06:57:37 pm »
trying to compile the current SVN project I get the following error:

/usr/include/SFML/Network/Selector.inl: In member function »Type sf::Selector< <template-parameter-1-1> >::GetSocketReady(unsigned int) const«:
/usr/include/SFML/Network/Selector.inl:128: Fehler: expected `;' before »It«
/usr/include/SFML/Network/Selector.inl:129: Fehler: »It« wurde in diesem Gültigkeitsbereich nicht definiert

"wurde in diesem Gültigkeitsbereich nicht definiert" means:
"was not defined in this scope"

Lines 128 and 129 are:
Code: [Select]

 SocketTable::const_iterator It = mySockets.find(static_cast<SocketHelper::SocketType>(i));
                if (It != mySockets.end())

looking up that stuff in Selector.hpp SocketTable is a:
std::map<SocketHelper::SocketType, Type>

But I cannot get further but this.. got no clue whats wrong.. some hint?
thx TGM
If I would like to add some functions to the Vec2 and Vec3 class
(dotProduct, crossProduct, scalar normalize, getLengthSQ, GetLength,angle between two vectors etc) would you like it to be a member of Vec or a function like all the other operators?

Feature requests / some suggestions
« on: March 03, 2008, 10:10:01 pm »
Hi, I started using SFML for some tiny 2D game...
Got some points that would make SFML way more comfortable to use:
1) Shader for sprites (at least Pixelshader)
2) Lines -> simple drawcall like App.Draw(Line(0,1,3,5)) -> draws a line between (0,1) and (3,5) (not sure about this one.. might be already implemented with:"Added a class to draw simple shapes (sf::Shape)")
3) a memory manager for resources (I know already on the list^^) but that ones REALY neccesary
Oh, and bevor I forget: GREAT Software!!!!

Pages: [1]