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

Pages: 1 2 [3]
31
Feature requests / core profile
« on: May 20, 2011, 07:13:46 pm »
ok thanks :)

32
Feature requests / core profile
« on: May 19, 2011, 07:47:32 pm »
I have a question:

if I wanted to port it to OGL 3.3+, then besides the Graphics folder is there anywhere else stuff related to OGL?

33
Feature requests / core profile
« on: May 19, 2011, 07:31:31 pm »
:(

then it'd really need to be ported to OGL 3.3+

This is actually a feature that would be unique in a sense that so far I've only seen it in freeglut, which is not so good when it comes to engine programming. On the other side SFML is great when it comes to engine programming.

34
Feature requests / core profile
« on: May 18, 2011, 07:53:40 pm »
Hi everyone,

I'd like to request a new feature for SFML: specifying core profile only context creation.
Lately I've ported my 'engine' to OGL 3.3 and it really annoyed me that with deprecated functions my application still compiles, and doesn't complain.
It gave me a few annoying problems concerning this, especially when I tried to pass things to shaders, and when I tried to render with deprecated VBO functions.
So I think it'd make everyone's life easier if one could specify that he only wants non-deprecated functions in his OGL context.
This context doesn't necessarily has to be a full OGL 4.1 context with every extension, because if we wanted extensions GLEW would solve the problem.

This feature can be found in Freeglut as well in which you have to use it something like this:
Code: [Select]
int main(int argc, char* argv[])
{
glutInit(&argc, argv);
glutInitContextVersion(4, 1);
glutInitContextFlags(GLUT_FORWARD_COMPATIBLE);
glutInitContextProfile(GLUT_CORE_PROFILE);
...
}


So it is extremely easy to use, and it makes your life a LOT easier.

Best regards,
Yours3lf

35
General discussions / SDL vs. SFML
« on: May 12, 2011, 05:10:53 pm »
@nhnaaldaia

thank you for the recommendation. I already have took my time, and have learnt SFML, and I'm using it, and I'm quite convinced.

Quote
I can honestly not say which is better...


I agree, however I felt like SFML gives you more freedom in terms of how you connect to it (inheritance etc.), but this is related to the library being object oriented.

36
General discussions / uft-8 characters
« on: May 03, 2011, 09:57:39 pm »
thanks now it works!!!
...after doing some research about how wstring works and conversions etc, etc...

37
General discussions / uft-8 characters
« on: May 02, 2011, 08:58:14 pm »
thanks for the reply Laurent,

I pass the character like this:
Code: [Select]
process_text_input(the_events.Text.Unicode);

the type of the string is std::string

and I display it like this:

Code: [Select]
void loop::display_text()
{
    the_context.Clear(sf::Color(255, 255, 255)); //the the_context is a sf::RenderWindow object

    if (the_clock.GetElapsedTime() < 0.400f) //this whole time checking is for the blinking | sign
    {
        the_text.SetString(the_string.substr(0, the_string.length()).insert(the_pos, 1, '|'));
    }
    else
    {
        the_text.SetString(the_string.substr(0, the_string.length()).insert(the_pos, 1, ' '));
        if (the_clock.GetElapsedTime() > 0.800f)
        {
            the_clock.Reset();
        }
    }

    the_context.Draw(the_text); //the the_text is a sf::text object

    the_context.Display();
}

void loop::start()
{
    the_context.Create(sf::VideoMode(1280, 720, 32), "This is an SFML based text editor.", sf::Style::Resize | sf::Style::Close);
the_context.Show(true);
    the_context.SetFramerateLimit(30);

    if (!the_font.LoadFromFile("verdana.ttf")) //this font does contain utf-8 characters
    {
        std::cerr << "Couldn't load font.\n";
        exit(1);
    }

    the_text.SetFont(the_font);
    the_text.SetColor(sf::Color(0, 0, 0));
    the_text.SetCharacterSize(20);

    while (the_context.IsOpened())
    {
        // Process events
        process_events();

        display_text();
    }
}


Best regards,
Yours3!f

38
General discussions / uft-8 characters
« on: May 02, 2011, 05:50:18 pm »
Hi all,

I've been trying to develop a text-editor in sfml based on the built-in text renderer, and I ran into this issue: I can't display uft-8 characters like őúűá etc. here's my code:

Code: [Select]
#include "keyboard.h"

void keyboard::process_keypress(sf::Key::Code keycode) //if a key is pressed then let's handle it
{
    keys[keycode] = true;

    if (keys[sf::Key::Back] == true)
    {
        //backslash pressed
        if (the_string.length() > 0)
        {
            if (!save_state)
            {
                if (the_pos > 0)
                {
                    the_string = the_string.replace(the_pos - 1, 1, "");
                    the_pos--;
                }
            }
            else
            {
                if (the_pos > save_pos)
                {
                    the_string = the_string.replace(the_pos - 1, 1, "");
                    the_pos--;
                }
            }
        }
    }

    if (keys[sf::Key::Delete] == true)
    {
        //delete pressed
        if (the_pos < the_string.length())
        {
            the_string = the_string.replace(the_pos, 1, "");
        }
    }

    if (keys[sf::Key::Return] == true)
    {
        //enter pressed
        the_string.insert(the_pos, 1, '\n');
        the_pos += 1;

        if (save_state)
        {
            std::string tmp_str = the_string.substr(the_string.substr(0, the_string.length() - 1).rfind("\n") + 1);
            tmp_str = tmp_str.substr(0, tmp_str.length() - 1);
            std::fstream f;
            f.open(tmp_str.c_str(), std::fstream::out);
            if (f.is_open())
            {
                f << write_out;
                f.close();
                the_string = write_out + "\nText successfully saved!\n";
                the_pos = the_string.length();
            }
            else
            {
                the_string = write_out + "\nCouldn't save the text!\n";
                the_pos = the_string.length();
            }
            save_state = false;

        }
    }

    if (keys[sf::Key::Escape] == true)
    {
        //escape pressed
        the_context.Close();
    }

    if (keys[sf::Key::Left] == true)
    {
        if (!save_state)
        {
            if (the_pos > 0)
            {
                the_pos--;
            }
        }
        else
        {
            if (the_pos > save_pos)
            {
                the_pos--;
            }
        }
    }

    if (keys[sf::Key::Right] == true)
    {
        if (the_pos < the_string.length())
        {
            the_pos++;
        }
    }

    if (keys[sf::Key::RControl] == true || keys[sf::Key::LControl] == true)
    {
        if (keys[sf::Key::S] == true)
        {
            write_out = the_string;
            the_string += "\nPlease enter the filename to save the text to: \n";
            the_pos = the_string.length();
            save_pos = the_pos;
            save_state = true;
            is_not_text = true;
        }
    }
}

void keyboard::process_keyrelease(sf::Key::Code keycode)
{
    keys[keycode] = false;
}

void keyboard::process_text_input(const unsigned int& char_code)
{
    for (int c = 0; c < not_text.size(); c++)
    {
        if (keys[not_text[c]] == true)
        {
            is_not_text = true;
        }
    }

    if (!is_not_text) //if it is text
    {
        the_string.insert(the_pos, 1, (wchar_t)char_code); //I think the problem lies here: I convert the incoming unsigned integer to a wchar_t which is supposed to be utf-8 right?
        the_pos++;
    }

    is_not_text = false;
}


I basically pass the character code to the process_text_input(...), in which I convert it to a wchar_t and insert it at the current position into the string I display.

So how can I render the unicode characters, what did I do wrong?

Best regards,
Yours3!f

39
General discussions / undefined reference to XRR*
« on: April 30, 2011, 10:55:32 pm »
I found the solution!

I just needed to link Xrandr and pthread, it solved it...

but it is really strange since on 10.10 I didn't need to do so...

nevermind it's working.

40
General discussions / undefined reference to XRR*
« on: April 30, 2011, 10:41:11 pm »
Hi all,

I recently moved from Ubuntu 10.10 to 11.04, and I had to reinstall everything including SFML, and when I tried to compile my project this error came up:

/usr/local/lib/libsfml-window.so.2.0: undefined reference to `XRRConfigCurrentConfiguration'

and a few others like this...

what I did was
-download the 2.0 snapshot
-cmake it
-it needed openal, sndfile and some other libs, so I installed them from synaptics
-then I compiled sfml and installed it
-then tried to compile my project

the project used to work before this...

any ideas?

Best regards,
Yours3!f

41
General discussions / SDL vs. SFML
« on: April 30, 2011, 09:46:22 pm »
is IRRLICHT some sort of wrapper for the APIs?

btw I want to teach pure OpenGL, and I posted this topic, because I want to focus on OpenGL not creating a window and messing around with it. this is one of SFML's great advantages.

42
General discussions / SDL vs. SFML
« on: April 13, 2011, 06:39:58 pm »
I asked because I did have problems with SDL in the past, but the great community at sdltutorials.com helped me out, and since then I didn't encounter any problems with it.
Another reason I asked this is because I want to teach engine programming for beginners, and I wondered if SFML was easier would it be better to show it to people instead of SDL's old fashioned way.
To add, after creating the SDL context, there is no other problem with it, since I don't intend to use it for anything else, and creating the context is real easy even with SDL.

Quote
it sounds like SDL uses software rendering, as opposed to the OpenGL-based hardware acceleration SFML uses


That is right but as I said:
Quote
I'm not curious about the two libraries' own 2D drawing performance.


Edit: specifying OpenGL context profiles would be the only reason I'd move to SFML, because I'd use other libraries for audio, networking, image loading etc.

Best regards,
Yours3lf

43
General discussions / SDL vs. SFML
« on: April 11, 2011, 08:33:17 am »
Hi everybody,

I've heard lots of great things about SFML, and I also experimented with it.

my question is, when using it for nothing more than input and window handling, and creating an OpenGL context (and using OpenGL for rendering) is it faster than SDL?

(I'm not curious about the two libraries' own 2D drawing performance.)

my other question would be, does it provide OpenGL context profiling like FreeGLUT does?

(I mean, can I specify that I only want the core context to be present?)

Best regards,
Yours3lf

Pages: 1 2 [3]
anything