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

Pages: [1]
1
General / Re: SFML 2.0 + Code::Blocks' autocompletion = problem
« on: May 13, 2013, 08:27:27 pm »
It happened to me when working with project stored in directory path with special characters (space, exclamation mark etc.)

2
General discussions / Re: A new logo for SFML
« on: May 01, 2013, 11:25:08 am »
Like the new site very much.

Dunno why you chose "power on/off" as a logo. If it was rotate switch the pointer had to be in work state, usually pointing top right for "mood direction", depicting it from power on button.
Pentagon form fits nicely to the number of SFML modules, and is what ties current symbol to SFML, chances of people catching resemblance are slim. More distinct memorable variants would be like in an arrow pointing upwards example, lower part looked like a box and arrow indicated taking out tools.
On the other hand "power on" is everywhere, if symbol is well tied to SFML logo would be very memorable.

All is imo, when I forget about button and look at it as a box with tools feeling is better, for now idea is ok and  logo is really well drawn.

3
Graphics / sf::Texture question
« on: January 20, 2012, 08:20:21 pm »
Ye, will use reserve() for now, and move on to others(probably std::deque) in future.
Thanks

4
Graphics / sf::Texture question
« on: January 20, 2012, 04:17:39 pm »
Thanks, for good and fast response.
Will try the options.

5
Graphics / sf::Texture question
« on: January 20, 2012, 02:24:17 pm »
I changed code, so that tempMap isn't crucial now, but the problem remained. sometimes white texture is replaced with crash.
Code: [Select]
fscanf(FileHandle, "%d\n", &AreaSize);
    int ID=0;
    for(int X = 0; X < AreaSize; X++)
    {
        for(int Y = 0; Y < AreaSize; Y++)
        {
            char MapFile[255];

            fscanf(FileHandle, "%s ", MapFile);
            CMap tempMap;
            MapList.push_back(tempMap);
            if(MapList[ID].OnLoad(MapFile) == false)
            {
                fclose(FileHandle);
                cout<<"error loading map";
                return false;
            }

   
            MapList[ID].m_TilesetTexture.LoadFromFile(TilesetFile);
            MapList[ID].m_TilesetSprite.SetTexture(MapList[ID].m_TilesetTexture);
       
            ID++;
        }
I found that vector::push_back may sometime reallocate memory http://www.cplusplus.com/reference/stl/vector/push_back/
Quote
effectively increases the vector size by one, which causes a reallocation of the internal allocated storage if the vector size was equal to the vector capacity before the call. Reallocations invalidate all previously obtained iterators, references and pointers.
I'm new to c++, can someone confirm, that because sf::Texture contains reference it's unsafe to use it with std::vector, is there some other workaround?

6
Graphics / sf::Texture question
« on: January 18, 2012, 02:51:58 pm »
Thanks, Laurent.
I hope I get it.

7
Graphics / sf::Texture question
« on: January 18, 2012, 01:45:08 pm »
I'm going through basic game tutorials at sdltutorials.com and change SDL parts to sfml.
It worked well so far, but recently I've encountered unexpected behavior and would like to know the cause of it.
Here http://www.sdltutorials.com/sdl-maps at CArea.cpp
Code: [Select]
bool CArea::OnLoad(char* File) {
    MapList.clear();
 
    FILE* FileHandle = fopen(File, "r");
 
    if(FileHandle == NULL) {
        return false;
    }
 
    char TilesetFile[255];
 
    fscanf(FileHandle, "%s\n", TilesetFile);
 
    if((Surf_Tileset = CSurface::OnLoad(TilesetFile)) == false) {
        fclose(FileHandle);
 
        return false;
    }
 
    fscanf(FileHandle, "%d\n", &AreaSize);
 
    for(int X = 0;X < AreaSize;X++) {
        for(int Y = 0;Y < AreaSize;Y++) {
            char MapFile[255];
 
            fscanf(FileHandle, "%s ", MapFile);
 
            CMap tempMap;
            if(tempMap.OnLoad(MapFile) == false) {
                fclose(FileHandle);
 
                return false;
            }
 
         tempMap.Surf_Tileset = Surf_Tileset;
 
            MapList.push_back(tempMap);
        }
        fscanf(FileHandle, "\n");
    }
 
    fclose(FileHandle);
 
    return true;
}

first i changed
Code: [Select]
Surf_Tileset = CSurface::OnLoad(TilesetFile) to
Code: [Select]
m_TilesetTexture1.LoadFromFile(TilesetFile)
And it works like it has to.

The problem part is
Code: [Select]
tempMap.Surf_Tileset = Surf_Tileset;which I changed to
Code: [Select]
tempMap.m_TilesetTexture=m_TilesetTexture1;
tempMap.m_TilesetSprite.SetTexture(tempMap.m_TilesetTexture);
and later it shows map with white instead of texture.

Then i changed it to
Code: [Select]
tempMap.m_TilesetTexture=m_TilesetTexture1;
tempMap.m_TilesetSprite.SetTexture(m_TilesetTexture1);
and it shows map fine this time.

Can someone tell why
Code: [Select]
tempMap.m_TilesetTexture=m_TilesetTexture1;
tempMap.m_TilesetSprite.SetTexture(tempMap.m_TilesetTexture);
shows white surface?

8
General discussions / The new time API
« on: January 14, 2012, 01:08:06 am »
Quote
"omfg what u done its not simple anymore"

9
General / SFML 2 offline documentation
« on: December 30, 2011, 08:47:27 am »
Quote from: "Nexus"
When building SFML with CMake, you can choose the option to generate the doc. When compiling the INSTALL project/rule, Doxygen is run.
Thanks, it helped.
Noted that Doxygen didn't run during installation, so additionally ran "mingw32-make doc" before "mingw32-make install".

10
General / SFML 2 offline documentation
« on: December 29, 2011, 10:25:00 pm »
Can someone share SFML2 documentation in html? So I could read it from phone.

11
General discussions / New graphics API ready
« on: December 29, 2011, 10:16:53 pm »
Quote from: "Laurent"
Quote
minor inconvenience sf::Text default Color is Black, while documentation says it's White.

It's fixed, thanks.
Wow, fast!
Additionally I get error on exit in Windows7 when using default font for sf::Text
Have legacy ati card.

12
General discussions / New graphics API ready
« on: December 29, 2011, 10:01:27 pm »
minor inconvenience sf::Text default Color is Black, while documentation says it's White.

13
General / SFML no grapics window
« on: December 28, 2011, 03:37:34 pm »
it also works with 1.6

Pages: [1]