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

Pages: 1 ... 3 4 [5]
61
General / Re: Loading from this tileset
« on: October 11, 2013, 09:37:42 am »
Ok. I came across Tiled and could easily create a tilemap using it. So, how can I use the tilemap in my codes(in C++)? If anyone can link me t a tutorial, it'd be very helpful.

Thanks


You could take a look at this thread:

'Tiled' Tile-map Loader

62
Graphics / Re: how to properly to use this shader?
« on: October 10, 2013, 04:02:12 pm »
Just a guess:

What height does texture have after you set it to your render texture at the end?

texture = render_texture.getTexture();

How do you draw those textures? Maybe your sprite's height is limited to the original fonts height.

63
General discussions / Re: Android/iOS "Soon"
« on: October 10, 2013, 09:29:34 am »
That would be awesome, thanks :)

OK, here is the quick an dirty fix to make the ESFML-Code on Github run with EGL under Linux.
I don't have my AC100 here to test it, so I hope I didn't forget anything:

WindowImplX11.cpp
Change Line 31:
#include <sfml/window/Linux/GlxContext.hpp>
to:
#ifndef SFML_EMBEDDED_SYSTEM
        #include <sfml/window/Linux/GlxContext.hpp>
    #else
        #include <sfml/window/Linux/EGLContext.hpp>
    #endif


Change Line 152:
XVisualInfo visualInfo = GlxContext::selectBestVisual(m_display, mode.bitsPerPixel, settings);

to:
#ifndef SFML_EMBEDDED_SYSTEM
        XVisualInfo visualInfo = GlxContext::selectBestVisual(m_display, mode.bitsPerPixel, settings);
    #else
        XVisualInfo visualInfo = _EGLContext::selectBestVisual(m_display, mode.bitsPerPixel, settings);
    #endif


EGLContext.hpp

Add:
    static XVisualInfo selectBestVisual(::Display* display, unsigned int bitsPerPixel, const ContextSettings& settings);


EGLContext.cpp

Add:
XVisualInfo _EGLContext::selectBestVisual(::Display* display, unsigned int bitsPerPixel, const ContextSettings& settings)
{
    // Retrieve all the visuals
    int count;
    XVisualInfo* visuals = XGetVisualInfo(display, 0, NULL, &count);
    if (visuals)
    {

        XVisualInfo bestVisual;
        //ToDo: Calculate best Visual        
        //select first Visual for now
        bestVisual = visuals[0];
        return bestVisual;
    }
    else
    {
        // Should never happen...
        err() << "No EGL visual found. You should check your graphics driver" << std::endl;

        return XVisualInfo();
    }
}

64
General discussions / Re: Android/iOS "Soon"
« on: October 09, 2013, 01:32:16 pm »
Yeah, great news :-).

@ iroquai_tribe
If you want it, i could give you my fix when I get home.

65
General discussions / Re: Android/iOS "Soon"
« on: October 09, 2013, 11:28:03 am »
Best way would bei to Include EGLContext in WindowsImplX11.cpp
and to add the Method "selectBestVisual"

The Problem is that you can't calculate the BestVisual with EGL in the same way as GLX.

But for a quick fix you can just return the first XVisualInfo.
Worked for me, but you might noch get Antialiasing.

66
General discussions / Re: SFML 2.0 Networking and the Raspberry Pi
« on: August 16, 2013, 09:27:54 am »
You should be able to compile it without any problems when you run "apt-get build-deb libsfml-dev" before running cmake.

That will pull all dependencies for SFML 1.6 in debian withouth installing SFML 1.6. Even libglx (which will be useless on an ARM-Platform like the RPi, since you would nee EGL instead of GLX).



Sonkun ported SFML to GLES:

https://github.com/Sonkun/esfml

There is also the branch which will be used for the SFML-Android-Support.


Right now there is a bug for ESFML which doesn't prevent it from compiling, but any Project you link against it will throw an error.
EglContext.hpp is missing an new Function (SelectBestVisual) that was implemented in GlxContext. And WindowImplX11.cpp only tries to call GlxContext.
I managed to get around this problem but it's rather dirty and not the best solution. (I just use the first XVisualInfo instead of calculation the best, since the functions in EGL are not the same as in GLX).
But it runs and in can draw textured triangles :-)
You will need libgles1 and libegl.

67
General discussions / Re: Android/iOS "Soon"
« on: August 14, 2013, 11:36:05 am »
GlxContext::selectBestVisual() was added by Laurent when commiting "Fixed ContextSettings ignored on Linux when creating a window (#35)" 24 days ago.

As far as I can see, GlxContext was not used in WindowsImplX11.cpp before, so EglContext didn't have to be included neither.

68
General discussions / Re: Android/iOS "Soon"
« on: August 09, 2013, 08:19:19 pm »
Damn, somehow I removed this from my last post:

Flags from make VERBOSE=1 for sfml-graphics:

-DGLEW_STATIC -DGL_GLEXT_PROTOTYPES -DSFML_EMBEDDED_SYSTEM -DSFML_GRAPHICS_EXPORTS -DSTBI_FAILURE_USERMSG -O3 -DNDEBUG -fPIC


So -DSFML_EMBEDDED_SYSTEM is not missing.

Nevertheless I try again with
Code: [Select]
cmake -DSFML_EMBEDDED_SYSTEM=1 ..
make
sudo make install

But compiling of the minimal example still causes the same error.

#include <sfml/graphics.hpp>
int main()
{
    sf::RenderWindow win(sf::VideoMode::getDesktopMode(),"test");
    return 0;
}
 

Code: [Select]
g++ -o test main.cpp -lsfml-graphics -lsfml-window -lsfml-system -lEGL -lGLESv1_CM
Code: [Select]
/usr/local/lib/libsfml-window.so: undefined reference to `sf::priv::GlxContext::selectBestVisual(_XDisplay*, unsigned int, sf::ContextSettings const&)'


Does the example compile on your RPi?

69
General discussions / Re: Android/iOS "Soon"
« on: August 09, 2013, 05:27:18 pm »
I used the master-branch in my test (downloaded as ZIP from github).

Now I cloned the master and tried again, same error.


Just to be clear: I can compile the esfml-Projekt using cmake and make, but I cant complie my project using libsfml, throwing:
/usr/local/lib/libsfml-window.so:-1: error: undefined reference to `sf::priv::GlxContext::selectBestVisual(_XDisplay*, unsigned int, sf::ContextSettings const&)'



Minimal example:
#include <sfml/graphics.hpp>
int main()
{
    sf::RenderWindow win(sf::VideoMode::getDesktopMode(),"test");
    return 0;
}

 

Compiling with:
g++ -o test main.cpp -lsfml-graphics -lsfml-window -lsfml-system -lEGL -lGLESv1_CM

btw: Is there a reason why you changed the Include-Files from UpperCase to LowerCase?
include/SFML/Graphics.hpp
to
include/sfml/graphics.hpp

70
General discussions / Re: Android/iOS "Soon"
« on: August 07, 2013, 10:48:10 pm »
Just a little Feedback to the esfml-port running under Ubuntu (AC100 withTegra2):

I get a undefined Reference error on GlxContext::selectBestVisual(...) in WindowImplX11.cpp

This is obvious since there is no GlxContext on SFML_EMBEDDED_SYSTEM but EGLContext, which is missing this function.

My workaround so far is to change WindowsImplX11.cpp (Step 1) to:

#ifndef SFML_EMBEDDED_SYSTEM
    visualInfo = GlxContext::selectBestVisual(m_display, mode.bitsPerPixel, settings);
#else
    visualInfo = _EGLContext::selectBestVisual(m_display, mode.bitsPerPixel, settings);
#endif

Step 2 is to implement selectBestVisual in EGLContext but i only return the first visual instead of calculating the best one. I couldn't figure it out for EGL :-(.

I guess this is no problem for Android since it does not use X11.

71
Window / Re: Question: Why a window stays open when using loops?
« on: August 06, 2013, 11:24:58 am »
Simple:
You create your window in the main function, so it is closed when the main function ends.
With the loop you keep your main-function running endlessly.

72
SFML projects / Re: [LandS] SFML Jam Game
« on: August 06, 2013, 10:04:19 am »
I had the same issues running Ubuntu 64bit.
I had to rename the libs from *.2.0 to *.2

73
Doesn't sf:: sleep take milliseconds AS parameter?

So you dont really send your Applications to sleep with 0.001

Ich would rather set a framelimit ind your renderwindow.

Pages: 1 ... 3 4 [5]
anything