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

Pages: 1 [2] 3 4 ... 13
16
Graphics / Re: Just wondering, Intel GPU
« on: June 26, 2012, 05:39:25 pm »
I know the rendertexture bug has been talked about many times, but I wanted to have a go at finding the problem, usually using a rendertexture would cause a segfault or something similar but I tried it again and something new showed up.

#include <SFML/Graphics.hpp>
#include <string>
#include <sstream>


std::string toString (const int& t) {  std::stringstream ss;  ss << t;  return ss.str();  }

int main()
{
    sf::RenderWindow App(sf::VideoMode(800, 600, 32), "SFML Graphics");     sf::Clock deltaClock;
    sf::Text t("This is on the main screen");                               sf::Text r("This is on the RT");
    sf::RenderTexture rt;                                                   sf::Sprite rts(rt.getTexture());

    t.setPosition(10,10);                                                   r.setPosition(20,20);
    rt.create(400,300);                                                     rts.setPosition(200, 150);
   
    while (App.isOpen())
    {
        sf::Event Event;
        while (App.pollEvent(Event))
        {
            if (Event.type == sf::Event::Closed)                            App.close();
            if (Event.type == sf::Event::KeyPressed &&
                Event.key.code == sf::Keyboard::Escape)                     App.close();
        }
       
        sf::Time dt = deltaClock.restart();                                 t.setString(toString(dt.asSeconds()));

        rt.setActive();                                                     rt.clear();
        rt.draw(r);                                                         rt.display();

        App.setActive();                                                    App.clear();
        App.draw(rts);                                                      App.draw(t);
        App.display();
    }
    return 0;
}

 

Quote
./SFML\ RT\ test
intel_do_flush_locked failed: No such file or directory

GDB output:
Quote
(gdb) run
Starting program: /home/richy/codeblocks/SFML RT test/bin/Debug/SFML RT test
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/i386-linux-gnu/libthread_db.so.1".
intel_do_flush_locked failed: No such file or directory
[Inferior 1 (process 3458) exited with code 01]

Valgrind output:
Code: [Select]
valgrind ./SFML\ RT\ test
==3462== Memcheck, a memory error detector
==3462== Copyright (C) 2002-2011, and GNU GPL'd, by Julian Seward et al.
==3462== Using Valgrind-3.7.0 and LibVEX; rerun with -h for copyright info
==3462== Command: ./SFML\ RT\ test
==3462==
--3462-- WARNING: Serious error when reading debug info
--3462-- When reading debug info from /usr/lib/i386-linux-gnu/mesa/libGL.so.1.2:
--3462-- Can't make sense of .got section mapping
--3462-- WARNING: Serious error when reading debug info
--3462-- When reading debug info from /usr/lib/i386-linux-gnu/libglapi.so.0.0.0:
--3462-- Can't make sense of .got section mapping
==3462== Conditional jump or move depends on uninitialised value(s)
==3462==    at 0x403D544: drm_intel_bufmgr_gem_init (in /usr/lib/i386-linux-gnu/libdrm_intel.so.1.0.0)
==3462==    by 0x4BFE4C8: ??? (in /usr/lib/i386-linux-gnu/dri/i965_dri.so)
==3462==    by 0x4C49E41: ??? (in /usr/lib/i386-linux-gnu/dri/i965_dri.so)
==3462==    by 0x45948BE: ??? (in /usr/lib/i386-linux-gnu/mesa/libGL.so.1.2)
==3462==
==3462== Conditional jump or move depends on uninitialised value(s)
==3462==    at 0x403D54F: drm_intel_bufmgr_gem_init (in /usr/lib/i386-linux-gnu/libdrm_intel.so.1.0.0)
==3462==    by 0x4BFE4C8: ??? (in /usr/lib/i386-linux-gnu/dri/i965_dri.so)
==3462==    by 0x4C49E41: ??? (in /usr/lib/i386-linux-gnu/dri/i965_dri.so)
==3462==    by 0x45948BE: ??? (in /usr/lib/i386-linux-gnu/mesa/libGL.so.1.2)
==3462==
==3462== Conditional jump or move depends on uninitialised value(s)
==3462==    at 0x403D55A: drm_intel_bufmgr_gem_init (in /usr/lib/i386-linux-gnu/libdrm_intel.so.1.0.0)
==3462==    by 0x4BFE4C8: ??? (in /usr/lib/i386-linux-gnu/dri/i965_dri.so)
==3462==    by 0x4C49E41: ??? (in /usr/lib/i386-linux-gnu/dri/i965_dri.so)
==3462==    by 0x45948BE: ??? (in /usr/lib/i386-linux-gnu/mesa/libGL.so.1.2)
==3462==
==3462== Conditional jump or move depends on uninitialised value(s)
==3462==    at 0x403D565: drm_intel_bufmgr_gem_init (in /usr/lib/i386-linux-gnu/libdrm_intel.so.1.0.0)
==3462==    by 0x4BFE4C8: ??? (in /usr/lib/i386-linux-gnu/dri/i965_dri.so)
==3462==    by 0x4C49E41: ??? (in /usr/lib/i386-linux-gnu/dri/i965_dri.so)
==3462==    by 0x45948BE: ??? (in /usr/lib/i386-linux-gnu/mesa/libGL.so.1.2)
==3462==
==3462== Conditional jump or move depends on uninitialised value(s)
==3462==    at 0x403D57D: drm_intel_bufmgr_gem_init (in /usr/lib/i386-linux-gnu/libdrm_intel.so.1.0.0)
==3462==    by 0x4BFE4C8: ??? (in /usr/lib/i386-linux-gnu/dri/i965_dri.so)
==3462==    by 0x4C49E41: ??? (in /usr/lib/i386-linux-gnu/dri/i965_dri.so)
==3462==    by 0x45948BE: ??? (in /usr/lib/i386-linux-gnu/mesa/libGL.so.1.2)
==3462==
==3462== Conditional jump or move depends on uninitialised value(s)
==3462==    at 0x403D588: drm_intel_bufmgr_gem_init (in /usr/lib/i386-linux-gnu/libdrm_intel.so.1.0.0)
==3462==    by 0x4BFE4C8: ??? (in /usr/lib/i386-linux-gnu/dri/i965_dri.so)
==3462==    by 0x4C49E41: ??? (in /usr/lib/i386-linux-gnu/dri/i965_dri.so)
==3462==    by 0x45948BE: ??? (in /usr/lib/i386-linux-gnu/mesa/libGL.so.1.2)
==3462==
==3462== Conditional jump or move depends on uninitialised value(s)
==3462==    at 0x403D593: drm_intel_bufmgr_gem_init (in /usr/lib/i386-linux-gnu/libdrm_intel.so.1.0.0)
==3462==    by 0x4BFE4C8: ??? (in /usr/lib/i386-linux-gnu/dri/i965_dri.so)
==3462==    by 0x4C49E41: ??? (in /usr/lib/i386-linux-gnu/dri/i965_dri.so)
==3462==    by 0x45948BE: ??? (in /usr/lib/i386-linux-gnu/mesa/libGL.so.1.2)
==3462==
==3462== Conditional jump or move depends on uninitialised value(s)
==3462==    at 0x403D59E: drm_intel_bufmgr_gem_init (in /usr/lib/i386-linux-gnu/libdrm_intel.so.1.0.0)
==3462==    by 0x4BFE4C8: ??? (in /usr/lib/i386-linux-gnu/dri/i965_dri.so)
==3462==    by 0x4C49E41: ??? (in /usr/lib/i386-linux-gnu/dri/i965_dri.so)
==3462==    by 0x45948BE: ??? (in /usr/lib/i386-linux-gnu/mesa/libGL.so.1.2)
==3462==
==3462== Conditional jump or move depends on uninitialised value(s)
==3462==    at 0x403D5A9: drm_intel_bufmgr_gem_init (in /usr/lib/i386-linux-gnu/libdrm_intel.so.1.0.0)
==3462==    by 0x4BFE4C8: ??? (in /usr/lib/i386-linux-gnu/dri/i965_dri.so)
==3462==    by 0x4C49E41: ??? (in /usr/lib/i386-linux-gnu/dri/i965_dri.so)
==3462==    by 0x45948BE: ??? (in /usr/lib/i386-linux-gnu/mesa/libGL.so.1.2)
==3462==
==3462== Conditional jump or move depends on uninitialised value(s)
==3462==    at 0x403D5B4: drm_intel_bufmgr_gem_init (in /usr/lib/i386-linux-gnu/libdrm_intel.so.1.0.0)
==3462==    by 0x4BFE4C8: ??? (in /usr/lib/i386-linux-gnu/dri/i965_dri.so)
==3462==    by 0x4C49E41: ??? (in /usr/lib/i386-linux-gnu/dri/i965_dri.so)
==3462==    by 0x45948BE: ??? (in /usr/lib/i386-linux-gnu/mesa/libGL.so.1.2)
==3462==
==3462== Conditional jump or move depends on uninitialised value(s)
==3462==    at 0x403D5BF: drm_intel_bufmgr_gem_init (in /usr/lib/i386-linux-gnu/libdrm_intel.so.1.0.0)
==3462==    by 0x4BFE4C8: ??? (in /usr/lib/i386-linux-gnu/dri/i965_dri.so)
==3462==    by 0x4C49E41: ??? (in /usr/lib/i386-linux-gnu/dri/i965_dri.so)
==3462==    by 0x45948BE: ??? (in /usr/lib/i386-linux-gnu/mesa/libGL.so.1.2)
==3462==
==3462== Conditional jump or move depends on uninitialised value(s)
==3462==    at 0x403D5CA: drm_intel_bufmgr_gem_init (in /usr/lib/i386-linux-gnu/libdrm_intel.so.1.0.0)
==3462==    by 0x4BFE4C8: ??? (in /usr/lib/i386-linux-gnu/dri/i965_dri.so)
==3462==    by 0x4C49E41: ??? (in /usr/lib/i386-linux-gnu/dri/i965_dri.so)
==3462==    by 0x45948BE: ??? (in /usr/lib/i386-linux-gnu/mesa/libGL.so.1.2)
==3462==
==3462== Conditional jump or move depends on uninitialised value(s)
==3462==    at 0x403D5D5: drm_intel_bufmgr_gem_init (in /usr/lib/i386-linux-gnu/libdrm_intel.so.1.0.0)
==3462==    by 0x4BFE4C8: ??? (in /usr/lib/i386-linux-gnu/dri/i965_dri.so)
==3462==    by 0x4C49E41: ??? (in /usr/lib/i386-linux-gnu/dri/i965_dri.so)
==3462==    by 0x45948BE: ??? (in /usr/lib/i386-linux-gnu/mesa/libGL.so.1.2)
==3462==
==3462== Conditional jump or move depends on uninitialised value(s)
==3462==    at 0x403D5E0: drm_intel_bufmgr_gem_init (in /usr/lib/i386-linux-gnu/libdrm_intel.so.1.0.0)
==3462==    by 0x4BFE4C8: ??? (in /usr/lib/i386-linux-gnu/dri/i965_dri.so)
==3462==    by 0x4C49E41: ??? (in /usr/lib/i386-linux-gnu/dri/i965_dri.so)
==3462==    by 0x45948BE: ??? (in /usr/lib/i386-linux-gnu/mesa/libGL.so.1.2)
==3462==
==3462== Conditional jump or move depends on uninitialised value(s)
==3462==    at 0x403D5EB: drm_intel_bufmgr_gem_init (in /usr/lib/i386-linux-gnu/libdrm_intel.so.1.0.0)
==3462==    by 0x4BFE4C8: ??? (in /usr/lib/i386-linux-gnu/dri/i965_dri.so)
==3462==    by 0x4C49E41: ??? (in /usr/lib/i386-linux-gnu/dri/i965_dri.so)
==3462==    by 0x45948BE: ??? (in /usr/lib/i386-linux-gnu/mesa/libGL.so.1.2)
==3462==
==3462== Conditional jump or move depends on uninitialised value(s)
==3462==    at 0x403D5F6: drm_intel_bufmgr_gem_init (in /usr/lib/i386-linux-gnu/libdrm_intel.so.1.0.0)
==3462==    by 0x4BFE4C8: ??? (in /usr/lib/i386-linux-gnu/dri/i965_dri.so)
==3462==    by 0x4C49E41: ??? (in /usr/lib/i386-linux-gnu/dri/i965_dri.so)
==3462==    by 0x45948BE: ??? (in /usr/lib/i386-linux-gnu/mesa/libGL.so.1.2)
==3462==
==3462== Conditional jump or move depends on uninitialised value(s)
==3462==    at 0x403D601: drm_intel_bufmgr_gem_init (in /usr/lib/i386-linux-gnu/libdrm_intel.so.1.0.0)
==3462==    by 0x4BFE4C8: ??? (in /usr/lib/i386-linux-gnu/dri/i965_dri.so)
==3462==    by 0x4C49E41: ??? (in /usr/lib/i386-linux-gnu/dri/i965_dri.so)
==3462==    by 0x45948BE: ??? (in /usr/lib/i386-linux-gnu/mesa/libGL.so.1.2)
==3462==
==3462== Conditional jump or move depends on uninitialised value(s)
==3462==    at 0x403D60C: drm_intel_bufmgr_gem_init (in /usr/lib/i386-linux-gnu/libdrm_intel.so.1.0.0)
==3462==    by 0x4BFE4C8: ??? (in /usr/lib/i386-linux-gnu/dri/i965_dri.so)
==3462==    by 0x4C49E41: ??? (in /usr/lib/i386-linux-gnu/dri/i965_dri.so)
==3462==    by 0x45948BE: ??? (in /usr/lib/i386-linux-gnu/mesa/libGL.so.1.2)
==3462==
==3462== Conditional jump or move depends on uninitialised value(s)
==3462==    at 0x403D617: drm_intel_bufmgr_gem_init (in /usr/lib/i386-linux-gnu/libdrm_intel.so.1.0.0)
==3462==    by 0x4BFE4C8: ??? (in /usr/lib/i386-linux-gnu/dri/i965_dri.so)
==3462==    by 0x4C49E41: ??? (in /usr/lib/i386-linux-gnu/dri/i965_dri.so)
==3462==    by 0x45948BE: ??? (in /usr/lib/i386-linux-gnu/mesa/libGL.so.1.2)
==3462==
==3462== Conditional jump or move depends on uninitialised value(s)
==3462==    at 0x403D622: drm_intel_bufmgr_gem_init (in /usr/lib/i386-linux-gnu/libdrm_intel.so.1.0.0)
==3462==    by 0x4BFE4C8: ??? (in /usr/lib/i386-linux-gnu/dri/i965_dri.so)
==3462==    by 0x4C49E41: ??? (in /usr/lib/i386-linux-gnu/dri/i965_dri.so)
==3462==    by 0x45948BE: ??? (in /usr/lib/i386-linux-gnu/mesa/libGL.so.1.2)
==3462==
==3462== Conditional jump or move depends on uninitialised value(s)
==3462==    at 0x403D62D: drm_intel_bufmgr_gem_init (in /usr/lib/i386-linux-gnu/libdrm_intel.so.1.0.0)
==3462==    by 0x4BFE4C8: ??? (in /usr/lib/i386-linux-gnu/dri/i965_dri.so)
==3462==    by 0x4C49E41: ??? (in /usr/lib/i386-linux-gnu/dri/i965_dri.so)
==3462==    by 0x45948BE: ??? (in /usr/lib/i386-linux-gnu/mesa/libGL.so.1.2)
==3462==
==3462== Conditional jump or move depends on uninitialised value(s)
==3462==    at 0x403DA10: drm_intel_bufmgr_gem_init (in /usr/lib/i386-linux-gnu/libdrm_intel.so.1.0.0)
==3462==    by 0x4BFE4C8: ??? (in /usr/lib/i386-linux-gnu/dri/i965_dri.so)
==3462==    by 0x4C49E41: ??? (in /usr/lib/i386-linux-gnu/dri/i965_dri.so)
==3462==    by 0x45948BE: ??? (in /usr/lib/i386-linux-gnu/mesa/libGL.so.1.2)
==3462==
==3462== Conditional jump or move depends on uninitialised value(s)
==3462==    at 0x403DA1B: drm_intel_bufmgr_gem_init (in /usr/lib/i386-linux-gnu/libdrm_intel.so.1.0.0)
==3462==    by 0x4BFE4C8: ??? (in /usr/lib/i386-linux-gnu/dri/i965_dri.so)
==3462==    by 0x4C49E41: ??? (in /usr/lib/i386-linux-gnu/dri/i965_dri.so)
==3462==    by 0x45948BE: ??? (in /usr/lib/i386-linux-gnu/mesa/libGL.so.1.2)
==3462==
==3462== Conditional jump or move depends on uninitialised value(s)
==3462==    at 0x403DA26: drm_intel_bufmgr_gem_init (in /usr/lib/i386-linux-gnu/libdrm_intel.so.1.0.0)
==3462==    by 0x4BFE4C8: ??? (in /usr/lib/i386-linux-gnu/dri/i965_dri.so)
==3462==    by 0x4C49E41: ??? (in /usr/lib/i386-linux-gnu/dri/i965_dri.so)
==3462==    by 0x45948BE: ??? (in /usr/lib/i386-linux-gnu/mesa/libGL.so.1.2)
==3462==
==3462== Conditional jump or move depends on uninitialised value(s)
==3462==    at 0x403DA31: drm_intel_bufmgr_gem_init (in /usr/lib/i386-linux-gnu/libdrm_intel.so.1.0.0)
==3462==    by 0x4BFE4C8: ??? (in /usr/lib/i386-linux-gnu/dri/i965_dri.so)
==3462==    by 0x4C49E41: ??? (in /usr/lib/i386-linux-gnu/dri/i965_dri.so)
==3462==    by 0x45948BE: ??? (in /usr/lib/i386-linux-gnu/mesa/libGL.so.1.2)
==3462==
==3462== Conditional jump or move depends on uninitialised value(s)
==3462==    at 0x403DA3C: drm_intel_bufmgr_gem_init (in /usr/lib/i386-linux-gnu/libdrm_intel.so.1.0.0)
==3462==    by 0x4BFE4C8: ??? (in /usr/lib/i386-linux-gnu/dri/i965_dri.so)
==3462==    by 0x4C49E41: ??? (in /usr/lib/i386-linux-gnu/dri/i965_dri.so)
==3462==    by 0x45948BE: ??? (in /usr/lib/i386-linux-gnu/mesa/libGL.so.1.2)
==3462==
==3462== Conditional jump or move depends on uninitialised value(s)
==3462==    at 0x403DA47: drm_intel_bufmgr_gem_init (in /usr/lib/i386-linux-gnu/libdrm_intel.so.1.0.0)
==3462==    by 0x4BFE4C8: ??? (in /usr/lib/i386-linux-gnu/dri/i965_dri.so)
==3462==    by 0x4C49E41: ??? (in /usr/lib/i386-linux-gnu/dri/i965_dri.so)
==3462==    by 0x45948BE: ??? (in /usr/lib/i386-linux-gnu/mesa/libGL.so.1.2)
==3462==
==3462== Conditional jump or move depends on uninitialised value(s)
==3462==    at 0x403DA52: drm_intel_bufmgr_gem_init (in /usr/lib/i386-linux-gnu/libdrm_intel.so.1.0.0)
==3462==    by 0x4BFE4C8: ??? (in /usr/lib/i386-linux-gnu/dri/i965_dri.so)
==3462==    by 0x4C49E41: ??? (in /usr/lib/i386-linux-gnu/dri/i965_dri.so)
==3462==    by 0x45948BE: ??? (in /usr/lib/i386-linux-gnu/mesa/libGL.so.1.2)
==3462==
==3462== Conditional jump or move depends on uninitialised value(s)
==3462==    at 0x403DA5D: drm_intel_bufmgr_gem_init (in /usr/lib/i386-linux-gnu/libdrm_intel.so.1.0.0)
==3462==    by 0x4BFE4C8: ??? (in /usr/lib/i386-linux-gnu/dri/i965_dri.so)
==3462==    by 0x4C49E41: ??? (in /usr/lib/i386-linux-gnu/dri/i965_dri.so)
==3462==    by 0x45948BE: ??? (in /usr/lib/i386-linux-gnu/mesa/libGL.so.1.2)
==3462==
==3462== Conditional jump or move depends on uninitialised value(s)
==3462==    at 0x403D7F3: drm_intel_bufmgr_gem_init (in /usr/lib/i386-linux-gnu/libdrm_intel.so.1.0.0)
==3462==    by 0x4BFE4C8: ??? (in /usr/lib/i386-linux-gnu/dri/i965_dri.so)
==3462==    by 0x4C49E41: ??? (in /usr/lib/i386-linux-gnu/dri/i965_dri.so)
==3462==    by 0x45948BE: ??? (in /usr/lib/i386-linux-gnu/mesa/libGL.so.1.2)
==3462==
==3462== Conditional jump or move depends on uninitialised value(s)
==3462==    at 0x403D7FA: drm_intel_bufmgr_gem_init (in /usr/lib/i386-linux-gnu/libdrm_intel.so.1.0.0)
==3462==    by 0x4BFE4C8: ??? (in /usr/lib/i386-linux-gnu/dri/i965_dri.so)
==3462==    by 0x4C49E41: ??? (in /usr/lib/i386-linux-gnu/dri/i965_dri.so)
==3462==    by 0x45948BE: ??? (in /usr/lib/i386-linux-gnu/mesa/libGL.so.1.2)
==3462==
==3462== Conditional jump or move depends on uninitialised value(s)
==3462==    at 0x403DA8C: drm_intel_bufmgr_gem_init (in /usr/lib/i386-linux-gnu/libdrm_intel.so.1.0.0)
==3462==    by 0x4BFE4C8: ??? (in /usr/lib/i386-linux-gnu/dri/i965_dri.so)
==3462==    by 0x4C49E41: ??? (in /usr/lib/i386-linux-gnu/dri/i965_dri.so)
==3462==    by 0x45948BE: ??? (in /usr/lib/i386-linux-gnu/mesa/libGL.so.1.2)
==3462==
==3462== Conditional jump or move depends on uninitialised value(s)
==3462==    at 0x403DA93: drm_intel_bufmgr_gem_init (in /usr/lib/i386-linux-gnu/libdrm_intel.so.1.0.0)
==3462==    by 0x4BFE4C8: ??? (in /usr/lib/i386-linux-gnu/dri/i965_dri.so)
==3462==    by 0x4C49E41: ??? (in /usr/lib/i386-linux-gnu/dri/i965_dri.so)
==3462==    by 0x45948BE: ??? (in /usr/lib/i386-linux-gnu/mesa/libGL.so.1.2)
==3462==
==3462== Conditional jump or move depends on uninitialised value(s)
==3462==    at 0x403DA9A: drm_intel_bufmgr_gem_init (in /usr/lib/i386-linux-gnu/libdrm_intel.so.1.0.0)
==3462==    by 0x4BFE4C8: ??? (in /usr/lib/i386-linux-gnu/dri/i965_dri.so)
==3462==    by 0x4C49E41: ??? (in /usr/lib/i386-linux-gnu/dri/i965_dri.so)
==3462==    by 0x45948BE: ??? (in /usr/lib/i386-linux-gnu/mesa/libGL.so.1.2)
==3462==
==3462== Conditional jump or move depends on uninitialised value(s)
==3462==    at 0x403DAA9: drm_intel_bufmgr_gem_init (in /usr/lib/i386-linux-gnu/libdrm_intel.so.1.0.0)
==3462==    by 0x4BFE4C8: ??? (in /usr/lib/i386-linux-gnu/dri/i965_dri.so)
==3462==    by 0x4C49E41: ??? (in /usr/lib/i386-linux-gnu/dri/i965_dri.so)
==3462==    by 0x45948BE: ??? (in /usr/lib/i386-linux-gnu/mesa/libGL.so.1.2)
==3462==
==3462== Conditional jump or move depends on uninitialised value(s)
==3462==    at 0x403D80A: drm_intel_bufmgr_gem_init (in /usr/lib/i386-linux-gnu/libdrm_intel.so.1.0.0)
==3462==    by 0x4BFE4C8: ??? (in /usr/lib/i386-linux-gnu/dri/i965_dri.so)
==3462==    by 0x4C49E41: ??? (in /usr/lib/i386-linux-gnu/dri/i965_dri.so)
==3462==    by 0x45948BE: ??? (in /usr/lib/i386-linux-gnu/mesa/libGL.so.1.2)
==3462==
==3462== Conditional jump or move depends on uninitialised value(s)
==3462==    at 0x403DCF6: drm_intel_bufmgr_gem_init (in /usr/lib/i386-linux-gnu/libdrm_intel.so.1.0.0)
==3462==    by 0x4BFE4C8: ??? (in /usr/lib/i386-linux-gnu/dri/i965_dri.so)
==3462==    by 0x4C49E41: ??? (in /usr/lib/i386-linux-gnu/dri/i965_dri.so)
==3462==    by 0x45948BE: ??? (in /usr/lib/i386-linux-gnu/mesa/libGL.so.1.2)
==3462==
==3462== Conditional jump or move depends on uninitialised value(s)
==3462==    at 0x403DD01: drm_intel_bufmgr_gem_init (in /usr/lib/i386-linux-gnu/libdrm_intel.so.1.0.0)
==3462==    by 0x4BFE4C8: ??? (in /usr/lib/i386-linux-gnu/dri/i965_dri.so)
==3462==    by 0x4C49E41: ??? (in /usr/lib/i386-linux-gnu/dri/i965_dri.so)
==3462==    by 0x45948BE: ??? (in /usr/lib/i386-linux-gnu/mesa/libGL.so.1.2)
==3462==
==3462== Conditional jump or move depends on uninitialised value(s)
==3462==    at 0x403DD11: drm_intel_bufmgr_gem_init (in /usr/lib/i386-linux-gnu/libdrm_intel.so.1.0.0)
==3462==    by 0x4BFE4C8: ??? (in /usr/lib/i386-linux-gnu/dri/i965_dri.so)
==3462==    by 0x4C49E41: ??? (in /usr/lib/i386-linux-gnu/dri/i965_dri.so)
==3462==    by 0x45948BE: ??? (in /usr/lib/i386-linux-gnu/mesa/libGL.so.1.2)
==3462==
==3462== Syscall param ioctl(generic) points to uninitialised byte(s)
==3462==    at 0x432C869: ioctl (syscall-template.S:82)
==3462==    by 0x47AD8C3: drmIoctl (in /usr/lib/i386-linux-gnu/libdrm.so.2.4.0)
==3462==    by 0x403B928: ??? (in /usr/lib/i386-linux-gnu/libdrm_intel.so.1.0.0)
==3462==    by 0x4036F94: drm_intel_bo_alloc_tiled (in /usr/lib/i386-linux-gnu/libdrm_intel.so.1.0.0)
==3462==    by 0x4BFE854: ??? (in /usr/lib/i386-linux-gnu/dri/i965_dri.so)
==3462==    by 0x4C49E41: ??? (in /usr/lib/i386-linux-gnu/dri/i965_dri.so)
==3462==    by 0x45948BE: ??? (in /usr/lib/i386-linux-gnu/mesa/libGL.so.1.2)
==3462==  Address 0xbeac0658 is on thread 1's stack
==3462==
==3462== Syscall param ioctl(generic) points to uninitialised byte(s)
==3462==    at 0x432C869: ioctl (syscall-template.S:82)
==3462==    by 0x47AD8C3: drmIoctl (in /usr/lib/i386-linux-gnu/libdrm.so.2.4.0)
==3462==    by 0x403A1B6: ??? (in /usr/lib/i386-linux-gnu/libdrm_intel.so.1.0.0)
==3462==    by 0x403C020: ??? (in /usr/lib/i386-linux-gnu/libdrm_intel.so.1.0.0)
==3462==    by 0x4036FD3: drm_intel_bo_unreference (in /usr/lib/i386-linux-gnu/libdrm_intel.so.1.0.0)
==3462==    by 0x4BFE87C: ??? (in /usr/lib/i386-linux-gnu/dri/i965_dri.so)
==3462==    by 0x4C49E41: ??? (in /usr/lib/i386-linux-gnu/dri/i965_dri.so)
==3462==    by 0x45948BE: ??? (in /usr/lib/i386-linux-gnu/mesa/libGL.so.1.2)
==3462==  Address 0xbeac062c is on thread 1's stack
==3462==
==3462== Syscall param ioctl(generic) points to uninitialised byte(s)
==3462==    at 0x432C869: ioctl (syscall-template.S:82)
==3462==    by 0x47AD8C3: drmIoctl (in /usr/lib/i386-linux-gnu/libdrm.so.2.4.0)
==3462==    by 0x403B928: ??? (in /usr/lib/i386-linux-gnu/libdrm_intel.so.1.0.0)
==3462==    by 0x4036F13: drm_intel_bo_alloc (in /usr/lib/i386-linux-gnu/libdrm_intel.so.1.0.0)
==3462==    by 0x4BEE3A6: intel_batchbuffer_reset (in /usr/lib/i386-linux-gnu/dri/i965_dri.so)
==3462==    by 0x4BEE401: intel_batchbuffer_init (in /usr/lib/i386-linux-gnu/dri/i965_dri.so)
==3462==    by 0x4BF4093: intelInitContext (in /usr/lib/i386-linux-gnu/dri/i965_dri.so)
==3462==    by 0x4C0E0AC: brwCreateContext (in /usr/lib/i386-linux-gnu/dri/i965_dri.so)
==3462==    by 0x4BFDB17: ??? (in /usr/lib/i386-linux-gnu/dri/i965_dri.so)
==3462==    by 0x47E294F: ???
==3462==  Address 0xbeac02a8 is on thread 1's stack
==3462==
==3462== Syscall param ioctl(generic) points to uninitialised byte(s)
==3462==    at 0x432C869: ioctl (syscall-template.S:82)
==3462==    by 0x47AD8C3: drmIoctl (in /usr/lib/i386-linux-gnu/libdrm.so.2.4.0)
==3462==    by 0x403CC56: drm_intel_bo_gem_create_from_name (in /usr/lib/i386-linux-gnu/libdrm_intel.so.1.0.0)
==3462==    by 0x4BFD19E: intel_region_alloc_for_handle (in /usr/lib/i386-linux-gnu/dri/i965_dri.so)
==3462==    by 0x4BF34DC: intel_update_renderbuffers (in /usr/lib/i386-linux-gnu/dri/i965_dri.so)
==3462==    by 0x4BF3B77: intel_prepare_render (in /usr/lib/i386-linux-gnu/dri/i965_dri.so)
==3462==    by 0x4BF4675: intelMakeCurrent (in /usr/lib/i386-linux-gnu/dri/i965_dri.so)
==3462==    by 0x4C4975A: ??? (in /usr/lib/i386-linux-gnu/dri/i965_dri.so)
==3462==    by 0x459550C: ??? (in /usr/lib/i386-linux-gnu/mesa/libGL.so.1.2)
==3462==  Address 0xbeac07b8 is on thread 1's stack
==3462==
==3462== Syscall param ioctl(generic) points to uninitialised byte(s)
==3462==    at 0x432C869: ioctl (syscall-template.S:82)
==3462==    by 0x47AD8C3: drmIoctl (in /usr/lib/i386-linux-gnu/libdrm.so.2.4.0)
==3462==    by 0x403CCCB: drm_intel_bo_gem_create_from_name (in /usr/lib/i386-linux-gnu/libdrm_intel.so.1.0.0)
==3462==    by 0x4BFD19E: intel_region_alloc_for_handle (in /usr/lib/i386-linux-gnu/dri/i965_dri.so)
==3462==    by 0x4BF34DC: intel_update_renderbuffers (in /usr/lib/i386-linux-gnu/dri/i965_dri.so)
==3462==    by 0x4BF3B77: intel_prepare_render (in /usr/lib/i386-linux-gnu/dri/i965_dri.so)
==3462==    by 0x4BF4675: intelMakeCurrent (in /usr/lib/i386-linux-gnu/dri/i965_dri.so)
==3462==    by 0x4C4975A: ??? (in /usr/lib/i386-linux-gnu/dri/i965_dri.so)
==3462==    by 0x459550C: ??? (in /usr/lib/i386-linux-gnu/mesa/libGL.so.1.2)
==3462==  Address 0xbeac07c8 is on thread 1's stack
==3462==
==3462== Syscall param writev(vector[...]) points to uninitialised byte(s)
==3462==    at 0x432C9AE: writev (writev.c:51)
==3462==    by 0x401BD3B: ??? (in /lib/i386-linux-gnu/ld-2.15.so)
==3462==  Address 0x5cd0d6c is 36 bytes inside a block of size 16,384 alloc'd
==3462==    at 0x402A5E6: calloc (in /usr/lib/valgrind/vgpreload_memcheck-x86-linux.so)
==3462==    by 0x45FFA01: XOpenDisplay (in /usr/lib/i386-linux-gnu/libX11.so.6.3.0)
==3462==    by 0x4129240: sf::priv::WindowImplX11::WindowImplX11(sf::VideoMode, std::string const&, unsigned long) (WindowImplX11.cpp:104)
==3462==    by 0x4124720: sf::priv::WindowImpl::create(sf::VideoMode, std::string const&, unsigned int) (WindowImpl.cpp:60)
==3462==    by 0x4123E4C: sf::Window::create(sf::VideoMode, std::string const&, unsigned int, sf::ContextSettings const&) (Window.cpp:114)
==3462==    by 0x40930B5: sf::RenderWindow::RenderWindow(sf::VideoMode, std::string const&, unsigned int, sf::ContextSettings const&) (RenderWindow.cpp:45)
==3462==    by 0x804A2E1: main (main.cpp:10)
==3462==
==3462== Syscall param writev(vector[...]) points to uninitialised byte(s)
==3462==    at 0x432C9AE: writev (writev.c:51)
==3462==    by 0x5D1DEF7: ???
==3462==  Address 0x5cd0d6d is 37 bytes inside a block of size 16,384 alloc'd
==3462==    at 0x402A5E6: calloc (in /usr/lib/valgrind/vgpreload_memcheck-x86-linux.so)
==3462==    by 0x45FFA01: XOpenDisplay (in /usr/lib/i386-linux-gnu/libX11.so.6.3.0)
==3462==    by 0x4129240: sf::priv::WindowImplX11::WindowImplX11(sf::VideoMode, std::string const&, unsigned long) (WindowImplX11.cpp:104)
==3462==    by 0x4124720: sf::priv::WindowImpl::create(sf::VideoMode, std::string const&, unsigned int) (WindowImpl.cpp:60)
==3462==    by 0x4123E4C: sf::Window::create(sf::VideoMode, std::string const&, unsigned int, sf::ContextSettings const&) (Window.cpp:114)
==3462==    by 0x40930B5: sf::RenderWindow::RenderWindow(sf::VideoMode, std::string const&, unsigned int, sf::ContextSettings const&) (RenderWindow.cpp:45)
==3462==    by 0x804A2E1: main (main.cpp:10)
==3462==
==3462== Syscall param ioctl(generic) points to uninitialised byte(s)
==3462==    at 0x432C869: ioctl (syscall-template.S:82)
==3462==    by 0x47AD8C3: drmIoctl (in /usr/lib/i386-linux-gnu/libdrm.so.2.4.0)
==3462==    by 0x4039C47: ??? (in /usr/lib/i386-linux-gnu/libdrm_intel.so.1.0.0)
==3462==    by 0x4037457: drm_intel_bo_busy (in /usr/lib/i386-linux-gnu/libdrm_intel.so.1.0.0)
==3462==    by 0x4C02FA6: ??? (in /usr/lib/i386-linux-gnu/dri/i965_dri.so)
==3462==    by 0x4D819FB: ??? (in /usr/lib/i386-linux-gnu/dri/libdricore.so)
==3462==    by 0x4D84E90: _mesa_TexSubImage2D (in /usr/lib/i386-linux-gnu/dri/libdricore.so)
==3462==    by 0x409E8A3: sf::Texture::update(sf::Image const&) (Texture.cpp:338)
==3462==    by 0x409DE1C: sf::Texture::loadFromImage(sf::Image const&, sf::Rect<int> const&) (Texture.cpp:194)
==3462==    by 0x407977B: sf::Font::Page::Page() (Font.cpp:608)
==3462==    by 0x4079CA6: std::map<unsigned int, sf::Font::Page, std::less<unsigned int>, std::allocator<std::pair<unsigned int const, sf::Font::Page> > >::operator[](unsigned int const&) (stl_map.h:453)
==3462==    by 0x407889E: sf::Font::getGlyph(unsigned int, unsigned int, bool) const (Font.cpp:240)
==3462==  Address 0xbeac03bc is on thread 1's stack
==3462==
==3462== Syscall param ioctl(generic) points to uninitialised byte(s)
==3462==    at 0x432C869: ioctl (syscall-template.S:82)
==3462==    by 0x47AD8C3: drmIoctl (in /usr/lib/i386-linux-gnu/libdrm.so.2.4.0)
==3462==    by 0x403B00C: ??? (in /usr/lib/i386-linux-gnu/libdrm_intel.so.1.0.0)
==3462==    by 0x403CE0A: drm_intel_gem_bo_map_gtt (in /usr/lib/i386-linux-gnu/libdrm_intel.so.1.0.0)
==3462==    by 0x4BFCD11: intel_region_map (in /usr/lib/i386-linux-gnu/dri/i965_dri.so)
==3462==    by 0x4BFBE2A: intel_miptree_map (in /usr/lib/i386-linux-gnu/dri/i965_dri.so)
==3462==    by 0x4C0147C: ??? (in /usr/lib/i386-linux-gnu/dri/i965_dri.so)
==3462==    by 0x4D967FF: ??? (in /usr/lib/i386-linux-gnu/dri/libdricore.so)
==3462==    by 0x4D96E04: _mesa_store_texsubimage2d (in /usr/lib/i386-linux-gnu/dri/libdricore.so)
==3462==    by 0x4C02F69: ??? (in /usr/lib/i386-linux-gnu/dri/i965_dri.so)
==3462==    by 0x4D819FB: ??? (in /usr/lib/i386-linux-gnu/dri/libdricore.so)
==3462==    by 0x4D84E90: _mesa_TexSubImage2D (in /usr/lib/i386-linux-gnu/dri/libdricore.so)
==3462==  Address 0xbeac0174 is on thread 1's stack
==3462==
==3462== Syscall param ioctl(generic) points to uninitialised byte(s)
==3462==    at 0x432C869: ioctl (syscall-template.S:82)
==3462==    by 0x47AD8C3: drmIoctl (in /usr/lib/i386-linux-gnu/libdrm.so.2.4.0)
==3462==    by 0x403A096: ??? (in /usr/lib/i386-linux-gnu/libdrm_intel.so.1.0.0)
==3462==    by 0x4037047: drm_intel_bo_subdata (in /usr/lib/i386-linux-gnu/libdrm_intel.so.1.0.0)
==3462==    by 0x4C23F6C: brw_upload_cache (in /usr/lib/i386-linux-gnu/dri/i965_dri.so)
==3462==    by 0x4C27178: ??? (in /usr/lib/i386-linux-gnu/dri/i965_dri.so)
==3462==    by 0x4C2748D: ??? (in /usr/lib/i386-linux-gnu/dri/i965_dri.so)
==3462==    by 0x4C2642E: brw_upload_state (in /usr/lib/i386-linux-gnu/dri/i965_dri.so)
==3462==    by 0x4C116F6: brw_draw_prims (in /usr/lib/i386-linux-gnu/dri/i965_dri.so)
==3462==    by 0x4DC769D: ??? (in /usr/lib/i386-linux-gnu/dri/libdricore.so)
==3462==    by 0x40915FC: sf::RenderTarget::draw(sf::Vertex const*, unsigned int, sf::PrimitiveType, sf::RenderStates const&) (RenderTarget.cpp:208)
==3462==    by 0x40A1B16: sf::VertexArray::draw(sf::RenderTarget&, sf::RenderStates) const (VertexArray.cpp:147)
==3462==  Address 0xbea9c8e4 is on thread 1's stack
==3462==
==3462== Syscall param ioctl(generic) points to uninitialised byte(s)
==3462==    at 0x432C869: ioctl (syscall-template.S:82)
==3462==    by 0x47AD8C3: drmIoctl (in /usr/lib/i386-linux-gnu/libdrm.so.2.4.0)
==3462==    by 0x403A73E: ??? (in /usr/lib/i386-linux-gnu/libdrm_intel.so.1.0.0)
==3462==    by 0x4036FF7: drm_intel_bo_map (in /usr/lib/i386-linux-gnu/libdrm_intel.so.1.0.0)
==3462==    by 0x4C23B61: ??? (in /usr/lib/i386-linux-gnu/dri/i965_dri.so)
==3462==    by 0x4C23FB6: brw_upload_cache (in /usr/lib/i386-linux-gnu/dri/i965_dri.so)
==3462==    by 0x4C305BD: do_wm_prog (in /usr/lib/i386-linux-gnu/dri/i965_dri.so)
==3462==    by 0x4C30C71: ??? (in /usr/lib/i386-linux-gnu/dri/i965_dri.so)
==3462==    by 0x4C2642E: brw_upload_state (in /usr/lib/i386-linux-gnu/dri/i965_dri.so)
==3462==    by 0x4C116F6: brw_draw_prims (in /usr/lib/i386-linux-gnu/dri/i965_dri.so)
==3462==    by 0x4DC769D: ??? (in /usr/lib/i386-linux-gnu/dri/libdricore.so)
==3462==    by 0x40915FC: sf::RenderTarget::draw(sf::Vertex const*, unsigned int, sf::PrimitiveType, sf::RenderStates const&) (RenderTarget.cpp:208)
==3462==  Address 0xbeac05e8 is on thread 1's stack
==3462==
intel_do_flush_locked failed: No such file or directory
==3462==
==3462== HEAP SUMMARY:
==3462==     in use at exit: 53,533,694 bytes in 7,744 blocks
==3462==   total heap usage: 19,859 allocs, 12,115 frees, 55,040,139 bytes allocated
==3462==
==3462== LEAK SUMMARY:
==3462==    definitely lost: 16,682 bytes in 5 blocks
==3462==    indirectly lost: 0 bytes in 0 blocks
==3462==      possibly lost: 52,957,398 bytes in 6,416 blocks
==3462==    still reachable: 559,614 bytes in 1,323 blocks
==3462==         suppressed: 0 bytes in 0 blocks
==3462== Rerun with --leak-check=full to see details of leaked memory
==3462==
==3462== For counts of detected and suppressed errors, rerun with: -v
==3462== Use --track-origins=yes to see where uninitialised values come from
==3462== ERROR SUMMARY: 229 errors from 50 contexts (suppressed: 0 from 0)

Do you have any idea what this could be? or where this error could originate?

17
Graphics / Re: Just wondering, Intel GPU
« on: May 05, 2012, 02:13:55 pm »
2.0 RC is what im using, and I have the latest mesa drivers,I remember a while back I think I updated to some beta drivers and it worked but I got like 5fps

18
Graphics / Re: Just wondering, Intel GPU
« on: May 05, 2012, 04:14:18 am »
the game run normally, with gdb, with valgrind and with valgrind -v
Doesnt really give any errors as to why it closes
Code: [Select]
./richy@richy-laptop:~/codeblocks/agamecpp/bin/Debug$ ./Agamed
Using OpenGL 2.1
Using resolution: 1024x576
Antialiasing Level of 2 was unavailable, using level 0 instead.
Loading file: ./Resources/Images/loading.png
Loading file: ./Resources/Fonts/visitor1.ttf
Loading file: ./Resources/Images/PalmTree.png
1
2
3
4
5
6
7
8
9
10
11
richy@richy-laptop:~/codeblocks/agamecpp/bin/Debug$ gdb ./Agamed
GNU gdb (Ubuntu/Linaro 7.3-0ubuntu2) 7.3-2011.08
Copyright (C) 2011 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "i686-linux-gnu".
For bug reporting instructions, please see:
<http://bugs.launchpad.net/gdb-linaro/>...
Reading symbols from /home/richy/codeblocks/agamecpp/bin/Debug/Agamed...done.
(gdb) run
Starting program: /home/richy/codeblocks/agamecpp/bin/Debug/Agamed
[Thread debugging using libthread_db enabled]
Using OpenGL 2.1
Using resolution: 1024x576
Antialiasing Level of 2 was unavailable, using level 0 instead.
Loading file: ./Resources/Images/loading.png
Loading file: ./Resources/Fonts/visitor1.ttf
Loading file: ./Resources/Images/PalmTree.png
1
2
3
4
5
6
7
8
9
10
11
[Inferior 1 (process 2706) exited with code 01]
(gdb) exit
Undefined command: "exit".  Try "help".
(gdb) quit
richy@richy-laptop:~/codeblocks/agamecpp/bin/Debug$ valgrind ./Agamed
==2713== Memcheck, a memory error detector
==2713== Copyright (C) 2002-2010, and GNU GPL'd, by Julian Seward et al.
==2713== Using Valgrind-3.6.1-Debian and LibVEX; rerun with -h for copyright info
==2713== Command: ./Agamed
==2713==
==2713== Invalid read of size 4
==2713==    at 0x4C72112: _mesa_make_extension_string (in /usr/lib/i386-linux-gnu/dri/libdricore.so)
==2713==    by 0x4C4C637: _mesa_make_current (in /usr/lib/i386-linux-gnu/dri/libdricore.so)
==2713==    by 0x4B72B40: intelMakeCurrent (in /usr/lib/i386-linux-gnu/dri/i965_dri.so)
==2713==    by 0x4B669AE: ??? (in /usr/lib/i386-linux-gnu/dri/i965_dri.so)
==2713==    by 0x4559B8C: ??? (in /usr/lib/i386-linux-gnu/mesa/libGL.so.1.2)
==2713==    by 0x4531B96: glXMakeContextCurrent (in /usr/lib/i386-linux-gnu/mesa/libGL.so.1.2)
==2713==    by 0x4531D22: glXMakeCurrent (in /usr/lib/i386-linux-gnu/mesa/libGL.so.1.2)
==2713==    by 0x410F9B3: sf::priv::GlContext::setActive(bool) (GlContext.cpp:201)
==2713==    by 0x410FB10: sf::priv::GlContext::initialize() (GlContext.cpp:256)
==2713==    by 0x410F7C1: sf::priv::GlContext::create() (GlContext.cpp:143)
==2713==    by 0x410F538: (anonymous namespace)::getInternalContext() (GlContext.cpp:87)
==2713==    by 0x410F769: sf::priv::GlContext::ensureContext() (GlContext.cpp:135)
==2713==  Address 0x4848308 is 0 bytes inside a block of size 1 alloc'd
==2713==    at 0x402732C: calloc (vg_replace_malloc.c:467)
==2713==    by 0x4C722DE: _mesa_make_extension_string (in /usr/lib/i386-linux-gnu/dri/libdricore.so)
==2713==    by 0x4C4C637: _mesa_make_current (in /usr/lib/i386-linux-gnu/dri/libdricore.so)
==2713==    by 0x4B72B40: intelMakeCurrent (in /usr/lib/i386-linux-gnu/dri/i965_dri.so)
==2713==    by 0x4B669AE: ??? (in /usr/lib/i386-linux-gnu/dri/i965_dri.so)
==2713==    by 0x4559B8C: ??? (in /usr/lib/i386-linux-gnu/mesa/libGL.so.1.2)
==2713==    by 0x4531B96: glXMakeContextCurrent (in /usr/lib/i386-linux-gnu/mesa/libGL.so.1.2)
==2713==    by 0x4531D22: glXMakeCurrent (in /usr/lib/i386-linux-gnu/mesa/libGL.so.1.2)
==2713==    by 0x410F9B3: sf::priv::GlContext::setActive(bool) (GlContext.cpp:201)
==2713==    by 0x410FB10: sf::priv::GlContext::initialize() (GlContext.cpp:256)
==2713==    by 0x410F7C1: sf::priv::GlContext::create() (GlContext.cpp:143)
==2713==    by 0x410F538: (anonymous namespace)::getInternalContext() (GlContext.cpp:87)
==2713==
==2713== Syscall param writev(vector[...]) points to uninitialised byte(s)
==2713==    at 0x4335124: writev (writev.c:51)
==2713==    by 0x40004: ???
==2713==  Address 0x6ea554c is 36 bytes inside a block of size 16,384 alloc'd
==2713==    at 0x402732C: calloc (vg_replace_malloc.c:467)
==2713==    by 0x4598551: XOpenDisplay (in /usr/lib/i386-linux-gnu/libX11.so.6.3.0)
==2713==    by 0x4119240: sf::priv::WindowImplX11::WindowImplX11(sf::VideoMode, std::string const&, unsigned long) (WindowImplX11.cpp:104)
==2713==    by 0x4114720: sf::priv::WindowImpl::create(sf::VideoMode, std::string const&, unsigned int) (WindowImpl.cpp:60)
==2713==    by 0x4113E4C: sf::Window::create(sf::VideoMode, std::string const&, unsigned int, sf::ContextSettings const&) (Window.cpp:114)
==2713==    by 0x805C04C: Game::setupOpenGL() (Game.cpp:88)
==2713==    by 0x805C566: Game::Run() (Game.cpp:148)
==2713==    by 0x804FB7F: main (main.cpp:34)
==2713==
Using OpenGL 2.1
Using resolution: 1024x576
Antialiasing Level of 2 was unavailable, using level 0 instead.
Loading file: ./Resources/Images/loading.png
Loading file: ./Resources/Fonts/visitor1.ttf
Loading file: ./Resources/Images/PalmTree.png
==2713== Conditional jump or move depends on uninitialised value(s)
==2713==    at 0x805C5BC: Game::Run() (Game.cpp:166)
==2713==    by 0x804FB7F: main (main.cpp:34)
==2713==
1
2
3
4
5
6
7
8
9
10
11
==2713==
==2713== HEAP SUMMARY:
==2713==     in use at exit: 117,597,627 bytes in 4,841 blocks
==2713==   total heap usage: 12,669 allocs, 7,828 frees, 134,911,932 bytes allocated
==2713==
==2713== LEAK SUMMARY:
==2713==    definitely lost: 88 bytes in 1 blocks
==2713==    indirectly lost: 0 bytes in 0 blocks
==2713==      possibly lost: 44,674,635 bytes in 71 blocks
==2713==    still reachable: 72,922,904 bytes in 4,769 blocks
==2713==         suppressed: 0 bytes in 0 blocks
==2713== Rerun with --leak-check=full to see details of leaked memory
==2713==
==2713== For counts of detected and suppressed errors, rerun with: -v
==2713== Use --track-origins=yes to see where uninitialised values come from
==2713== ERROR SUMMARY: 8 errors from 3 contexts (suppressed: 95 from 11)
richy@richy-laptop:~/codeblocks/agamecpp/bin/Debug$ valgrind ./Agamed -v
==2716== Memcheck, a memory error detector
==2716== Copyright (C) 2002-2010, and GNU GPL'd, by Julian Seward et al.
==2716== Using Valgrind-3.6.1-Debian and LibVEX; rerun with -h for copyright info
==2716== Command: ./Agamed -v
==2716==
==2716== Invalid read of size 4
==2716==    at 0x4C72112: _mesa_make_extension_string (in /usr/lib/i386-linux-gnu/dri/libdricore.so)
==2716==    by 0x4C4C637: _mesa_make_current (in /usr/lib/i386-linux-gnu/dri/libdricore.so)
==2716==    by 0x4B72B40: intelMakeCurrent (in /usr/lib/i386-linux-gnu/dri/i965_dri.so)
==2716==    by 0x4B669AE: ??? (in /usr/lib/i386-linux-gnu/dri/i965_dri.so)
==2716==    by 0x4559B8C: ??? (in /usr/lib/i386-linux-gnu/mesa/libGL.so.1.2)
==2716==    by 0x4531B96: glXMakeContextCurrent (in /usr/lib/i386-linux-gnu/mesa/libGL.so.1.2)
==2716==    by 0x4531D22: glXMakeCurrent (in /usr/lib/i386-linux-gnu/mesa/libGL.so.1.2)
==2716==    by 0x410F9B3: sf::priv::GlContext::setActive(bool) (GlContext.cpp:201)
==2716==    by 0x410FB10: sf::priv::GlContext::initialize() (GlContext.cpp:256)
==2716==    by 0x410F7C1: sf::priv::GlContext::create() (GlContext.cpp:143)
==2716==    by 0x410F538: (anonymous namespace)::getInternalContext() (GlContext.cpp:87)
==2716==    by 0x410F769: sf::priv::GlContext::ensureContext() (GlContext.cpp:135)
==2716==  Address 0x4848308 is 0 bytes inside a block of size 1 alloc'd
==2716==    at 0x402732C: calloc (vg_replace_malloc.c:467)
==2716==    by 0x4C722DE: _mesa_make_extension_string (in /usr/lib/i386-linux-gnu/dri/libdricore.so)
==2716==    by 0x4C4C637: _mesa_make_current (in /usr/lib/i386-linux-gnu/dri/libdricore.so)
==2716==    by 0x4B72B40: intelMakeCurrent (in /usr/lib/i386-linux-gnu/dri/i965_dri.so)
==2716==    by 0x4B669AE: ??? (in /usr/lib/i386-linux-gnu/dri/i965_dri.so)
==2716==    by 0x4559B8C: ??? (in /usr/lib/i386-linux-gnu/mesa/libGL.so.1.2)
==2716==    by 0x4531B96: glXMakeContextCurrent (in /usr/lib/i386-linux-gnu/mesa/libGL.so.1.2)
==2716==    by 0x4531D22: glXMakeCurrent (in /usr/lib/i386-linux-gnu/mesa/libGL.so.1.2)
==2716==    by 0x410F9B3: sf::priv::GlContext::setActive(bool) (GlContext.cpp:201)
==2716==    by 0x410FB10: sf::priv::GlContext::initialize() (GlContext.cpp:256)
==2716==    by 0x410F7C1: sf::priv::GlContext::create() (GlContext.cpp:143)
==2716==    by 0x410F538: (anonymous namespace)::getInternalContext() (GlContext.cpp:87)
==2716==

Invalid argument
Use 'h', 'help', '?' to get he argument description

==2716==
==2716== HEAP SUMMARY:
==2716==     in use at exit: 18,038,149 bytes in 975 blocks
==2716==   total heap usage: 1,486 allocs, 511 frees, 18,211,552 bytes allocated
==2716==
==2716== LEAK SUMMARY:
==2716==    definitely lost: 0 bytes in 0 blocks
==2716==    indirectly lost: 0 bytes in 0 blocks
==2716==      possibly lost: 0 bytes in 0 blocks
==2716==    still reachable: 18,038,149 bytes in 975 blocks
==2716==         suppressed: 0 bytes in 0 blocks
==2716== Rerun with --leak-check=full to see details of leaked memory
==2716==
==2716== For counts of detected and suppressed errors, rerun with: -v
==2716== ERROR SUMMARY: 1 errors from 1 contexts (suppressed: 93 from 11)
richy@richy-laptop:~/codeblocks/agamecpp/bin/Debug$ valgrind -v ./Agamed
==2719== Memcheck, a memory error detector
==2719== Copyright (C) 2002-2010, and GNU GPL'd, by Julian Seward et al.
==2719== Using Valgrind-3.6.1-Debian and LibVEX; rerun with -h for copyright info
==2719== Command: ./Agamed
==2719==
--2719-- Valgrind options:
--2719--    --suppressions=/usr/lib/valgrind/debian-libc6-dbg.supp
--2719--    -v
--2719-- Contents of /proc/version:
--2719--   Linux version 3.0.0-19-generic (buildd@vernadsky) (gcc version 4.6.1 (Ubuntu/Linaro 4.6.1-9ubuntu3) ) #33-Ubuntu SMP Thu Apr 19 19:05:57 UTC 2012
--2719-- Arch and hwcaps: X86, x86-sse1-sse2
--2719-- Page sizes: currently 4096, max supported 4096
--2719-- Valgrind library directory: /usr/lib/valgrind
--2719-- Reading syms from /lib/i386-linux-gnu/ld-2.13.so (0x4000000)
--2719--   Considering /lib/i386-linux-gnu/ld-2.13.so ..
--2719--   .. CRC mismatch (computed a6c8b2f7 wanted 69f2d381)
--2719--   Considering /usr/lib/debug/lib/i386-linux-gnu/ld-2.13.so ..
--2719--   .. CRC is valid
--2719-- Reading syms from /home/richy/codeblocks/agamecpp/bin/Debug/Agamed (0x8048000)
--2719-- Reading syms from /usr/lib/valgrind/memcheck-x86-linux (0x38000000)
--2719--    object doesn't have a dynamic symbol table
--2719-- Reading suppressions file: /usr/lib/valgrind/debian-libc6-dbg.supp
--2719-- Reading suppressions file: /usr/lib/valgrind/default.supp
--2719-- REDIR: 0x4016b60 (index) redirected to 0x3803e847 (vgPlain_x86_linux_REDIR_FOR_index)
--2719-- Reading syms from /usr/lib/valgrind/vgpreload_core-x86-linux.so (0x4022000)
--2719-- Reading syms from /usr/lib/valgrind/vgpreload_memcheck-x86-linux.so (0x4025000)
==2719== WARNING: new redirection conflicts with existing -- ignoring it
--2719--     new: 0x04016b60 (index               ) R-> 0x04028c7e index
--2719-- REDIR: 0x4016d20 (strlen) redirected to 0x4029045 (strlen)
--2719-- Reading syms from /usr/local/lib/libsfml-graphics-d.so.2.0 (0x4048000)
--2719-- Reading syms from /usr/local/lib/libsfml-window-d.so.2.0 (0x4101000)
--2719-- Reading syms from /usr/local/lib/libsfml-system-d.so.2.0 (0x4125000)
--2719-- Reading syms from /usr/lib/i386-linux-gnu/libstdc++.so.6.0.16 (0x4136000)
--2719--   Considering /usr/lib/i386-linux-gnu/libstdc++.so.6.0.16 ..
--2719--   .. CRC mismatch (computed 0767ea0e wanted b08dd867)
--2719--    object doesn't have a symbol table
--2719-- Reading syms from /lib/i386-linux-gnu/libm-2.13.so (0x4221000)
--2719--   Considering /lib/i386-linux-gnu/libm-2.13.so ..
--2719--   .. CRC mismatch (computed 6e94624c wanted 22969979)
--2719--   Considering /usr/lib/debug/lib/i386-linux-gnu/libm-2.13.so ..
--2719--   .. CRC is valid
--2719-- Reading syms from /lib/i386-linux-gnu/libgcc_s.so.1 (0x424b000)
--2719--   Considering /lib/i386-linux-gnu/libgcc_s.so.1 ..
--2719--   .. CRC mismatch (computed b65cdc91 wanted 35537674)
--2719--    object doesn't have a symbol table
--2719-- Reading syms from /lib/i386-linux-gnu/libc-2.13.so (0x426a000)
--2719--   Considering /lib/i386-linux-gnu/libc-2.13.so ..
--2719--   .. CRC mismatch (computed 5d7f0723 wanted 3f8e3fd1)
--2719--   Considering /usr/lib/debug/lib/i386-linux-gnu/libc-2.13.so ..
--2719--   .. CRC is valid
--2719-- Reading syms from /lib/i386-linux-gnu/libpthread-2.13.so (0x43e8000)
--2719--   Considering /lib/i386-linux-gnu/libpthread-2.13.so ..
--2719--   .. CRC mismatch (computed 0b26b884 wanted 21b4acb3)
--2719--   Considering /usr/lib/debug/lib/i386-linux-gnu/libpthread-2.13.so ..
--2719--   .. CRC is valid
--2719-- Reading syms from /lib/i386-linux-gnu/libdl-2.13.so (0x4403000)
--2719--   Considering /lib/i386-linux-gnu/libdl-2.13.so ..
--2719--   .. CRC mismatch (computed e5b294cf wanted 30262032)
--2719--   Considering /usr/lib/debug/lib/i386-linux-gnu/libdl-2.13.so ..
--2719--   .. CRC is valid
--2719-- Reading syms from /usr/lib/i386-linux-gnu/libfreetype.so.6.6.2 (0x4408000)
--2719--   Considering /usr/lib/i386-linux-gnu/libfreetype.so.6.6.2 ..
--2719--   .. CRC mismatch (computed e0411edf wanted aadd0337)
--2719--    object doesn't have a symbol table
--2719-- Reading syms from /usr/lib/i386-linux-gnu/libGLEW.so.1.6.0 (0x449f000)
--2719--    object doesn't have a symbol table
--2719-- Reading syms from /usr/lib/i386-linux-gnu/libjpeg.so.62.0.0 (0x44f9000)
--2719--   Considering /usr/lib/i386-linux-gnu/libjpeg.so.62.0.0 ..
--2719--   .. CRC mismatch (computed e1fd38fa wanted 08d741ba)
--2719--    object doesn't have a symbol table
--2719-- Reading syms from /usr/lib/i386-linux-gnu/mesa/libGL.so.1.2 (0x451d000)
--2719--   Considering /usr/lib/i386-linux-gnu/mesa/libGL.so.1.2 ..
--2719--   .. CRC mismatch (computed 78999545 wanted cfa33ece)
--2719--    object doesn't have a symbol table
--2719-- Reading syms from /usr/lib/i386-linux-gnu/libX11.so.6.3.0 (0x4571000)
--2719--   Considering /usr/lib/i386-linux-gnu/libX11.so.6.3.0 ..
--2719--   .. CRC mismatch (computed d84f718c wanted 1d9ffd31)
--2719--    object doesn't have a symbol table
--2719-- Reading syms from /usr/lib/i386-linux-gnu/libXrandr.so.2.2.0 (0x46a7000)
--2719--   Considering /usr/lib/i386-linux-gnu/libXrandr.so.2.2.0 ..
--2719--   .. CRC mismatch (computed 880eb2ac wanted 33053b12)
--2719--    object doesn't have a symbol table
--2719-- Reading syms from /lib/i386-linux-gnu/librt-2.13.so (0x46b0000)
--2719--   Considering /lib/i386-linux-gnu/librt-2.13.so ..
--2719--   .. CRC mismatch (computed 748da8a2 wanted 41137cd2)
--2719--   Considering /usr/lib/debug/lib/i386-linux-gnu/librt-2.13.so ..
--2719--   .. CRC is valid
--2719-- Reading syms from /lib/i386-linux-gnu/libz.so.1.2.3.4 (0x46ba000)
--2719--   Considering /lib/i386-linux-gnu/libz.so.1.2.3.4 ..
--2719--   .. CRC mismatch (computed 995eb12f wanted 33a06a21)
--2719--    object doesn't have a symbol table
--2719-- Reading syms from /usr/lib/i386-linux-gnu/libglapi.so.0.0.0 (0x46cf000)
--2719--   Considering /usr/lib/i386-linux-gnu/libglapi.so.0.0.0 ..
--2719--   .. CRC mismatch (computed 2a7a5080 wanted 0176d417)
--2719--    object doesn't have a symbol table
--2719-- Reading syms from /usr/lib/i386-linux-gnu/libXext.so.6.4.0 (0x46e5000)
--2719--   Considering /usr/lib/i386-linux-gnu/libXext.so.6.4.0 ..
--2719--   .. CRC mismatch (computed c0607288 wanted e94ddf46)
--2719--    object doesn't have a symbol table
--2719-- Reading syms from /usr/lib/i386-linux-gnu/libXdamage.so.1.1.0 (0x46f8000)
--2719--   Considering /usr/lib/i386-linux-gnu/libXdamage.so.1.1.0 ..
--2719--   .. CRC mismatch (computed 83ea7c99 wanted 71e46542)
--2719--    object doesn't have a symbol table
--2719-- Reading syms from /usr/lib/i386-linux-gnu/libXfixes.so.3.1.0 (0x46fc000)
--2719--   Considering /usr/lib/i386-linux-gnu/libXfixes.so.3.1.0 ..
--2719--   .. CRC mismatch (computed 966dfda3 wanted 7165e6b6)
--2719--    object doesn't have a symbol table
--2719-- Reading syms from /usr/lib/i386-linux-gnu/libXxf86vm.so.1.0.0 (0x4703000)
--2719--   Considering /usr/lib/i386-linux-gnu/libXxf86vm.so.1.0.0 ..
--2719--   .. CRC mismatch (computed 48e683b9 wanted 95bc54ab)
--2719--    object doesn't have a symbol table
--2719-- Reading syms from /usr/lib/i386-linux-gnu/libdrm.so.2.4.0 (0x4709000)
--2719--   Considering /usr/lib/i386-linux-gnu/libdrm.so.2.4.0 ..
--2719--   .. CRC mismatch (computed 5820098d wanted d188bd92)
--2719--    object doesn't have a symbol table
--2719-- Reading syms from /usr/lib/i386-linux-gnu/libxcb.so.1.1.0 (0x4715000)
--2719--   Considering /usr/lib/i386-linux-gnu/libxcb.so.1.1.0 ..
--2719--   .. CRC mismatch (computed ea093d75 wanted 9ccac4bc)
--2719--    object doesn't have a symbol table
--2719-- Reading syms from /usr/lib/i386-linux-gnu/libXrender.so.1.3.0 (0x4734000)
--2719--   Considering /usr/lib/i386-linux-gnu/libXrender.so.1.3.0 ..
--2719--   .. CRC mismatch (computed ca4b965a wanted ab7c529f)
--2719--    object doesn't have a symbol table
--2719-- Reading syms from /usr/lib/i386-linux-gnu/libXau.so.6.0.0 (0x473f000)
--2719--   Considering /usr/lib/i386-linux-gnu/libXau.so.6.0.0 ..
--2719--   .. CRC mismatch (computed 028146c5 wanted e16b2942)
--2719--    object doesn't have a symbol table
--2719-- Reading syms from /usr/lib/i386-linux-gnu/libXdmcp.so.6.0.0 (0x4744000)
--2719--   Considering /usr/lib/i386-linux-gnu/libXdmcp.so.6.0.0 ..
--2719--   .. CRC mismatch (computed 79097260 wanted 766e3fcb)
--2719--    object doesn't have a symbol table
--2719-- REDIR: 0x42e89b0 (strstr) redirected to 0x4022499 (_vgnU_ifunc_wrapper)
--2719-- REDIR: 0x42e85f0 (__GI_strstr) redirected to 0x402af6e (strstr)
--2719-- REDIR: 0x42e1990 (rindex) redirected to 0x4028adc (rindex)
--2719-- REDIR: 0x42e1670 (__GI_strlen) redirected to 0x402902a (__GI_strlen)
--2719-- REDIR: 0x42e1010 (strcmp) redirected to 0x4022499 (_vgnU_ifunc_wrapper)
--2719-- REDIR: 0x438a6c0 (__strcmp_ssse3) redirected to 0x40299b8 (strcmp)
--2719-- REDIR: 0x41e59b0 (operator new(unsigned int)) redirected to 0x40283aa (operator new(unsigned int))
--2719-- REDIR: 0x42e7c10 (__GI_strncmp) redirected to 0x40294b2 (__GI_strncmp)
--2719-- REDIR: 0x42de780 (calloc) redirected to 0x4027253 (calloc)
--2719-- REDIR: 0x42dd790 (malloc) redirected to 0x40287f1 (malloc)
--2719-- REDIR: 0x42e2dc0 (memcpy) redirected to 0x4022499 (_vgnU_ifunc_wrapper)
--2719-- REDIR: 0x4382480 (__memcpy_ssse3) redirected to 0x4029b53 (memcpy)
--2719-- REDIR: 0x42ddc40 (free) redirected to 0x4027b7d (free)
--2719-- REDIR: 0x42e3f00 (strchrnul) redirected to 0x402ab9f (strchrnul)
--2719-- REDIR: 0x4350d10 (__strcpy_chk) redirected to 0x402ac06 (__strcpy_chk)
--2719-- REDIR: 0x42e27c0 (memset) redirected to 0x4022499 (_vgnU_ifunc_wrapper)
--2719-- REDIR: 0x4381370 (__memset_sse2) redirected to 0x402aa22 (memset)
--2719-- REDIR: 0x42e2700 (memmove) redirected to 0x4022499 (_vgnU_ifunc_wrapper)
--2719-- REDIR: 0x4384370 (__memmove_ssse3) redirected to 0x402aab3 (memmove)
--2719-- REDIR: 0x42ddd20 (realloc) redirected to 0x40288a0 (realloc)
--2719-- REDIR: 0x42e18e0 (strncpy) redirected to 0x4029217 (strncpy)
--2719-- REDIR: 0x42e1620 (strlen) redirected to 0x4022499 (_vgnU_ifunc_wrapper)
--2719-- REDIR: 0x42e8010 (__strlen_sse2_bsf) redirected to 0x402900f (strlen)
--2719-- REDIR: 0x42e0ea0 (index) redirected to 0x4028bc7 (index)
--2719-- REDIR: 0x42e1730 (strnlen) redirected to 0x4028fc3 (strnlen)
--2719-- Reading syms from /usr/lib/i386-linux-gnu/dri/i965_dri.so (0x4b4e000)
--2719--   Considering /usr/lib/i386-linux-gnu/dri/i965_dri.so ..
--2719--   .. CRC mismatch (computed b3c00d85 wanted a009c271)
--2719--    object doesn't have a symbol table
--2719-- Reading syms from /usr/lib/i386-linux-gnu/dri/libdricore.so (0x4c0f000)
--2719--   Considering /usr/lib/i386-linux-gnu/dri/libdricore.so ..
--2719--   .. CRC mismatch (computed da752803 wanted fbfed6ad)
--2719--    object doesn't have a symbol table
--2719-- Reading syms from /usr/lib/i386-linux-gnu/dri/libglsl.so (0x4e56000)
--2719--   Considering /usr/lib/i386-linux-gnu/dri/libglsl.so ..
--2719--   .. CRC mismatch (computed ac0d91b1 wanted 56cd01ea)
--2719--    object doesn't have a symbol table
--2719-- Reading syms from /lib/i386-linux-gnu/libexpat.so.1.5.2 (0x4f6a000)
--2719--   Considering /lib/i386-linux-gnu/libexpat.so.1.5.2 ..
--2719--   .. CRC mismatch (computed 87726f3a wanted 9b6d73eb)
--2719--    object doesn't have a symbol table
--2719-- Reading syms from /usr/lib/i386-linux-gnu/libdrm_intel.so.1.0.0 (0x4f94000)
--2719--   Considering /usr/lib/i386-linux-gnu/libdrm_intel.so.1.0.0 ..
--2719--   .. CRC mismatch (computed 6052c0ac wanted 46626250)
--2719--    object doesn't have a symbol table
--2719-- Reading syms from /usr/lib/i386-linux-gnu/libpciaccess.so.0.10.8 (0x4fa1000)
--2719--   Considering /usr/lib/i386-linux-gnu/libpciaccess.so.0.10.8 ..
--2719--   .. CRC mismatch (computed b2a578f2 wanted 29af767a)
--2719--    object doesn't have a symbol table
--2719-- REDIR: 0x42e10f0 (strcspn) redirected to 0x4022499 (_vgnU_ifunc_wrapper)
--2719-- REDIR: 0x42e23d0 (bcmp) redirected to 0x4022499 (_vgnU_ifunc_wrapper)
--2719-- REDIR: 0x4350b40 (__memcpy_chk) redirected to 0x4022499 (_vgnU_ifunc_wrapper)
--2719-- REDIR: 0x42e1890 (strncmp) redirected to 0x4022499 (_vgnU_ifunc_wrapper)
--2719-- REDIR: 0x42e2ab0 (stpcpy) redirected to 0x402a702 (stpcpy)
--2719-- REDIR: 0x438bb30 (__strncmp_ssse3) redirected to 0x4029449 (strncmp)
--2719-- REDIR: 0x42df080 (posix_memalign) redirected to 0x40271c4 (posix_memalign)
--2719-- REDIR: 0x42e10d0 (strcpy) redirected to 0x402907b (strcpy)
==2719== Invalid read of size 4
==2719==    at 0x4C72112: _mesa_make_extension_string (in /usr/lib/i386-linux-gnu/dri/libdricore.so)
==2719==    by 0x4C4C637: _mesa_make_current (in /usr/lib/i386-linux-gnu/dri/libdricore.so)
==2719==    by 0x4B72B40: intelMakeCurrent (in /usr/lib/i386-linux-gnu/dri/i965_dri.so)
==2719==    by 0x4B669AE: ??? (in /usr/lib/i386-linux-gnu/dri/i965_dri.so)
==2719==    by 0x4559B8C: ??? (in /usr/lib/i386-linux-gnu/mesa/libGL.so.1.2)
==2719==    by 0x4531B96: glXMakeContextCurrent (in /usr/lib/i386-linux-gnu/mesa/libGL.so.1.2)
==2719==    by 0x4531D22: glXMakeCurrent (in /usr/lib/i386-linux-gnu/mesa/libGL.so.1.2)
==2719==    by 0x410F9B3: sf::priv::GlContext::setActive(bool) (GlContext.cpp:201)
==2719==    by 0x410FB10: sf::priv::GlContext::initialize() (GlContext.cpp:256)
==2719==    by 0x410F7C1: sf::priv::GlContext::create() (GlContext.cpp:143)
==2719==    by 0x410F538: (anonymous namespace)::getInternalContext() (GlContext.cpp:87)
==2719==    by 0x410F769: sf::priv::GlContext::ensureContext() (GlContext.cpp:135)
==2719==  Address 0x4848308 is 0 bytes inside a block of size 1 alloc'd
==2719==    at 0x402732C: calloc (vg_replace_malloc.c:467)
==2719==    by 0x4C722DE: _mesa_make_extension_string (in /usr/lib/i386-linux-gnu/dri/libdricore.so)
==2719==    by 0x4C4C637: _mesa_make_current (in /usr/lib/i386-linux-gnu/dri/libdricore.so)
==2719==    by 0x4B72B40: intelMakeCurrent (in /usr/lib/i386-linux-gnu/dri/i965_dri.so)
==2719==    by 0x4B669AE: ??? (in /usr/lib/i386-linux-gnu/dri/i965_dri.so)
==2719==    by 0x4559B8C: ??? (in /usr/lib/i386-linux-gnu/mesa/libGL.so.1.2)
==2719==    by 0x4531B96: glXMakeContextCurrent (in /usr/lib/i386-linux-gnu/mesa/libGL.so.1.2)
==2719==    by 0x4531D22: glXMakeCurrent (in /usr/lib/i386-linux-gnu/mesa/libGL.so.1.2)
==2719==    by 0x410F9B3: sf::priv::GlContext::setActive(bool) (GlContext.cpp:201)
==2719==    by 0x410FB10: sf::priv::GlContext::initialize() (GlContext.cpp:256)
==2719==    by 0x410F7C1: sf::priv::GlContext::create() (GlContext.cpp:143)
==2719==    by 0x410F538: (anonymous namespace)::getInternalContext() (GlContext.cpp:87)
==2719==
--2719-- REDIR: 0x42e0cf0 (strcat) redirected to 0x4028d35 (strcat)
--2719-- REDIR: 0x438d520 (__memcmp_ssse3) redirected to 0x402a64c (bcmp)
--2719-- REDIR: 0x41e37f0 (operator delete(void*)) redirected to 0x4027894 (operator delete(void*))
==2719== Syscall param writev(vector[...]) points to uninitialised byte(s)
==2719==    at 0x4335124: writev (writev.c:51)
==2719==    by 0x40004: ???
==2719==  Address 0x6ea554c is 36 bytes inside a block of size 16,384 alloc'd
==2719==    at 0x402732C: calloc (vg_replace_malloc.c:467)
==2719==    by 0x4598551: XOpenDisplay (in /usr/lib/i386-linux-gnu/libX11.so.6.3.0)
==2719==    by 0x4119240: sf::priv::WindowImplX11::WindowImplX11(sf::VideoMode, std::string const&, unsigned long) (WindowImplX11.cpp:104)
==2719==    by 0x4114720: sf::priv::WindowImpl::create(sf::VideoMode, std::string const&, unsigned int) (WindowImpl.cpp:60)
==2719==    by 0x4113E4C: sf::Window::create(sf::VideoMode, std::string const&, unsigned int, sf::ContextSettings const&) (Window.cpp:114)
==2719==    by 0x805C04C: Game::setupOpenGL() (Game.cpp:88)
==2719==    by 0x805C566: Game::Run() (Game.cpp:148)
==2719==    by 0x804FB7F: main (main.cpp:34)
==2719==
--2719-- REDIR: 0x42e2230 (memchr) redirected to 0x4029b00 (memchr)
--2719-- Reading syms from /usr/lib/i386-linux-gnu/libXcursor.so.1.0.2 (0x70b7000)
--2719--   Considering /usr/lib/i386-linux-gnu/libXcursor.so.1.0.2 ..
--2719--   .. CRC mismatch (computed 27b8283e wanted cf02d89f)
--2719--    object doesn't have a symbol table
Using OpenGL 2.1
Using resolution: 1024x576
Antialiasing Level of 2 was unavailable, using level 0 instead.
Loading file: ./Resources/Images/loading.png
Loading file: ./Resources/Fonts/visitor1.ttf
Loading file: ./Resources/Images/PalmTree.png
==2719== Conditional jump or move depends on uninitialised value(s)
==2719==    at 0x805C5BC: Game::Run() (Game.cpp:166)
==2719==    by 0x804FB7F: main (main.cpp:34)
==2719==
1
2
3
4
5
6
7
8
9
10
11
==2719==
==2719== HEAP SUMMARY:
==2719==     in use at exit: 117,597,627 bytes in 4,841 blocks
==2719==   total heap usage: 12,670 allocs, 7,829 frees, 134,912,096 bytes allocated
==2719==
==2719== Searching for pointers to 4,841 not-freed blocks
==2719== Checked 54,532,328 bytes
==2719==
==2719== LEAK SUMMARY:
==2719==    definitely lost: 88 bytes in 1 blocks
==2719==    indirectly lost: 0 bytes in 0 blocks
==2719==      possibly lost: 44,674,635 bytes in 71 blocks
==2719==    still reachable: 72,922,904 bytes in 4,769 blocks
==2719==         suppressed: 0 bytes in 0 blocks
==2719== Rerun with --leak-check=full to see details of leaked memory
==2719==
==2719== Use --track-origins=yes to see where uninitialised values come from
==2719== ERROR SUMMARY: 8 errors from 3 contexts (suppressed: 95 from 11)
==2719==
==2719== 2 errors in context 1 of 3:
==2719== Conditional jump or move depends on uninitialised value(s)
==2719==    at 0x805C5BC: Game::Run() (Game.cpp:166)
==2719==    by 0x804FB7F: main (main.cpp:34)
==2719==
==2719==
==2719== 2 errors in context 2 of 3:
==2719== Syscall param writev(vector[...]) points to uninitialised byte(s)
==2719==    at 0x4335124: writev (writev.c:51)
==2719==    by 0x40004: ???
==2719==  Address 0x6ea554c is 36 bytes inside a block of size 16,384 alloc'd
==2719==    at 0x402732C: calloc (vg_replace_malloc.c:467)
==2719==    by 0x4598551: XOpenDisplay (in /usr/lib/i386-linux-gnu/libX11.so.6.3.0)
==2719==    by 0x4119240: sf::priv::WindowImplX11::WindowImplX11(sf::VideoMode, std::string const&, unsigned long) (WindowImplX11.cpp:104)
==2719==    by 0x4114720: sf::priv::WindowImpl::create(sf::VideoMode, std::string const&, unsigned int) (WindowImpl.cpp:60)
==2719==    by 0x4113E4C: sf::Window::create(sf::VideoMode, std::string const&, unsigned int, sf::ContextSettings const&) (Window.cpp:114)
==2719==    by 0x805C04C: Game::setupOpenGL() (Game.cpp:88)
==2719==    by 0x805C566: Game::Run() (Game.cpp:148)
==2719==    by 0x804FB7F: main (main.cpp:34)
==2719==
==2719==
==2719== 4 errors in context 3 of 3:
==2719== Invalid read of size 4
==2719==    at 0x4C72112: _mesa_make_extension_string (in /usr/lib/i386-linux-gnu/dri/libdricore.so)
==2719==    by 0x4C4C637: _mesa_make_current (in /usr/lib/i386-linux-gnu/dri/libdricore.so)
==2719==    by 0x4B72B40: intelMakeCurrent (in /usr/lib/i386-linux-gnu/dri/i965_dri.so)
==2719==    by 0x4B669AE: ??? (in /usr/lib/i386-linux-gnu/dri/i965_dri.so)
==2719==    by 0x4559B8C: ??? (in /usr/lib/i386-linux-gnu/mesa/libGL.so.1.2)
==2719==    by 0x4531B96: glXMakeContextCurrent (in /usr/lib/i386-linux-gnu/mesa/libGL.so.1.2)
==2719==    by 0x4531D22: glXMakeCurrent (in /usr/lib/i386-linux-gnu/mesa/libGL.so.1.2)
==2719==    by 0x410F9B3: sf::priv::GlContext::setActive(bool) (GlContext.cpp:201)
==2719==    by 0x410FB10: sf::priv::GlContext::initialize() (GlContext.cpp:256)
==2719==    by 0x410F7C1: sf::priv::GlContext::create() (GlContext.cpp:143)
==2719==    by 0x410F538: (anonymous namespace)::getInternalContext() (GlContext.cpp:87)
==2719==    by 0x410F769: sf::priv::GlContext::ensureContext() (GlContext.cpp:135)
==2719==  Address 0x4848308 is 0 bytes inside a block of size 1 alloc'd
==2719==    at 0x402732C: calloc (vg_replace_malloc.c:467)
==2719==    by 0x4C722DE: _mesa_make_extension_string (in /usr/lib/i386-linux-gnu/dri/libdricore.so)
==2719==    by 0x4C4C637: _mesa_make_current (in /usr/lib/i386-linux-gnu/dri/libdricore.so)
==2719==    by 0x4B72B40: intelMakeCurrent (in /usr/lib/i386-linux-gnu/dri/i965_dri.so)
==2719==    by 0x4B669AE: ??? (in /usr/lib/i386-linux-gnu/dri/i965_dri.so)
==2719==    by 0x4559B8C: ??? (in /usr/lib/i386-linux-gnu/mesa/libGL.so.1.2)
==2719==    by 0x4531B96: glXMakeContextCurrent (in /usr/lib/i386-linux-gnu/mesa/libGL.so.1.2)
==2719==    by 0x4531D22: glXMakeCurrent (in /usr/lib/i386-linux-gnu/mesa/libGL.so.1.2)
==2719==    by 0x410F9B3: sf::priv::GlContext::setActive(bool) (GlContext.cpp:201)
==2719==    by 0x410FB10: sf::priv::GlContext::initialize() (GlContext.cpp:256)
==2719==    by 0x410F7C1: sf::priv::GlContext::create() (GlContext.cpp:143)
==2719==    by 0x410F538: (anonymous namespace)::getInternalContext() (GlContext.cpp:87)
==2719==
--2719--
--2719-- used_suppression:     95 U1004-ARM-_dl_relocate_object
==2719==
==2719== ERROR SUMMARY: 8 errors from 3 contexts (suppressed: 95 from 11)

19
Graphics / Re: Just wondering, Intel GPU
« on: May 04, 2012, 07:27:55 pm »
I added a RenderTexture to my program on which I drew the delta time as such:
(this is in the main loop)

Code: [Select]
delta = clock.restart().asMilliseconds();
                std::cout << "1" << std::endl;
                App.setActive();
                std::cout << "2" << std::endl;
                App.clear(sf::Color::Black);
                std::cout << "3" << std::endl;
                gameStateManager.Draw();
                std::cout << "4" << std::endl;



                std::cout << "5" << std::endl;
                //drawDebug();
                std::cout << "6" << std::endl;
                sf::Text text( Util::toString(Game::delta) + " ms",*(fontManager.getFile("visitor1.ttf")) ,10);
                std::cout << "7" << std::endl;
                text.setPosition(5,5);
                std::cout << "8" << std::endl;
                text.setColor(sf::Color::White);
                std::cout << "9" << std::endl;

                rt.setActive();
                std::cout << "10" << std::endl;
                rt.clear();

                rt.draw(text);
                std::cout << "11" << std::endl;

                rt.display();
                std::cout << "12" << std::endl;
                sf::Sprite rtsp(rt.getTexture());
                std::cout << "13" << std::endl;

                App.setActive();
                std::cout << "14" << std::endl;
                App.draw(rtsp);
                std::cout << "15" << std::endl;
                App.display();
                std::cout << "16" << std::endl;
Making sure the sf::Text is created under the windows OGL context
It simply returns 1; and prints up to 11, meaning the rt.display seems to give the problem.

20
Graphics / Re: Just wondering, Intel GPU
« on: May 04, 2012, 07:13:17 pm »
Hmm, that seems to work fine :S maybe they have updated my drivers without me knowing.
Im going to try out some more involved renderTexture stuff

21
Graphics / Re: Just wondering, Intel GPU
« on: May 04, 2012, 05:29:19 pm »
Do we know what exactly is wrong with the RenderTextures on intel?
On my laptop a rendertexture causes the program to crash, yet creating a FBO with the following code works fine:



Code: [Select]
#include "./RenderTarget.hpp"
#include "./Program.hpp"

RenderTarget::RenderTarget(Program *p)
{
    prog = p;

    glfwGetWindowSize( &width, &height );
    //width = 512; height = 512;
}

RenderTarget::~RenderTarget()
{
    glDeleteTextures( 1, &texture );
//  free our framebuffer

glDeleteRenderbuffersEXT(1, &depthBuff);
glDeleteFramebuffersEXT( 1, &fbo );
}

GLuint RenderTarget::getTexture()
{
    return texture;
}

bool RenderTarget::Create()
{
    glGenRenderbuffersEXT(1, &depthBuff);
    glBindRenderbufferEXT(GL_RENDERBUFFER_EXT, depthBuff);

    glRenderbufferStorageEXT(GL_RENDERBUFFER_EXT, GL_DEPTH_COMPONENT, width, height); // Set the render buffer storage to be a depth component, with a width and height of the window

glFramebufferRenderbufferEXT(GL_FRAMEBUFFER_EXT, GL_DEPTH_ATTACHMENT_EXT, GL_RENDERBUFFER_EXT, depthBuff); // Set the render buffer of this buffer to the depth buffer

    glBindRenderbufferEXT(GL_RENDERBUFFER_EXT, 0);



    glGenTextures(1, &texture); // Generate one texture

glBindTexture(GL_TEXTURE_2D, texture); // Bind the texture fbo_texture

glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, width, height, 0, GL_RGBA, GL_UNSIGNED_BYTE, NULL); // Create a standard texture with the width and height of our window

// Setup the basic texture parameters

glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);

// Unbind the texture
glBindTexture(GL_TEXTURE_2D, 0);

glGenFramebuffersEXT(1, &fbo); // Generate one frame buffer and store the ID in fbo
glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, fbo); // Bind our frame buffer


glFramebufferTexture2DEXT(GL_FRAMEBUFFER_EXT, GL_COLOR_ATTACHMENT0_EXT, GL_TEXTURE_2D, texture, 0); // Attach the texture fbo_texture to the color buffer in our frame buffer
glFramebufferRenderbufferEXT(GL_FRAMEBUFFER_EXT, GL_DEPTH_ATTACHMENT_EXT, GL_RENDERBUFFER_EXT, depthBuff); // Attach the depth buffer fbo_depth to our frame buffer

GLenum status = glCheckFramebufferStatusEXT(GL_FRAMEBUFFER_EXT); // Check that status of our generated frame buffer

if (status != GL_FRAMEBUFFER_COMPLETE_EXT) // If the frame buffer does not report back as complete
{
std::cout << "Couldn't create frame buffer" << std::endl; // Make sure you include <iostream>

}

glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, 0); // Unbind our frame buffer
}

bool RenderTarget::Activate()
{
glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, fbo);
float aspectRatio = width / (float)height;
prog->Projection = glm::perspective(
                     prog->initialFoV,         // The horizontal Field of View, in degrees : the amount of "zoom". Think "camera lens". Usually between 90° (extra wide) and 30° (quite zoomed in)
                     aspectRatio, // Aspect Ratio. Depends on the size of your window. Notice that 4/3 == 800/600 == 1280/960, sounds familiar ?
                     0.1f,        // Near clipping plane. Keep as big as possible, or you'll get precision issues.
                     500.0f       // Far clipping plane. Keep as little as possible.
                 );

prog->View = glm::lookAt(
               glm::vec3(2.0f, 0.0f ,4.0f),           // Camera is here
               glm::vec3(0.0f), // and looks here : at the same position, plus "direction"
               glm::vec3(0.0f, 1.0f, 0.0f)                  // Head is up (set to 0,-1,0 to look upside-down)
           );
}

22
Graphics / Re: SFML2 Texture/Image loadFroPixels
« on: May 03, 2012, 07:45:21 pm »
Ok, So I got libRocket drawing, but there seems to be something weird going on with the resizing and input.
Also when the program is run I get some OGL errors:

Quote
libRocket/Samples/basic/sfml/bin/Debug$ ./Agamed
An internal OpenGL call failed in RenderTarget.cpp (244) : GL_STACK_UNDERFLOW, this command would cause a stack underflow
An internal OpenGL call failed in RenderTarget.cpp (245) : GL_STACK_UNDERFLOW, this command would cause a stack underflow
An internal OpenGL call failed in RenderTarget.cpp (247) : GL_STACK_UNDERFLOW, this command would cause a stack underflow
An internal OpenGL call failed in RenderTarget.cpp (249) : GL_STACK_UNDERFLOW, this command would cause a stack underflow
An internal OpenGL call failed in RenderTarget.cpp (251) : GL_STACK_UNDERFLOW, this command would cause a stack underflow
[Info] - Loaded font face Delicious Bold (from Delicious-Bold.otf).
[Info] - Loaded font face Delicious Bold Italic (from Delicious-BoldItalic.otf).
[Info] - Loaded font face Delicious Italic (from Delicious-Italic.otf).
[Info] - Loaded font face Delicious Roman (from Delicious-Roman.otf).
[Info] - Loaded font face Lacuna Regular Regular (from byte stream).
[Info] - Loaded font face Lacuna Italic Regular (from byte stream).

this is what the 2.0 code looks like:
RenderInterface:

Code: [Select]
/*
 * This source file is part of libRocket, the HTML/CSS Interface Middleware
 *
 * For the latest information, see http://www.librocket.com
 *
 * Copyright (c) 2008-2010 Nuno Silva
 *
 * Permission is hereby granted, free of charge, to any person obtaining a copy
 * of this software and associated documentation files (the "Software"), to deal
 * in the Software without restriction, including without limitation the rights
 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
 * copies of the Software, and to permit persons to whom the Software is
 * furnished to do so, subject to the following conditions:
 *
 * The above copyright notice and this permission notice shall be included in
 * all copies or substantial portions of the Software.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
 * THE SOFTWARE.
 *
 */

#include <Rocket/Core/Core.h>
#include "RenderInterfaceSFML.h"
#include <GL/gl.h>

#define GL_CLAMP_TO_EDGE 0x812F

// If built with the GL Easy Extension library we can compile geometry to VBO's
// http://www.opengl.org/sdk/libs/GLee/
#ifdef ENABLE_GLEE
#include <GL/glee.h>

class RocketSFMLRendererGeometryHandler
{
public:
GLuint VertexID, IndexID;
int NumVertices;
Rocket::Core::TextureHandle Texture;

RocketSFMLRendererGeometryHandler() : VertexID(0), IndexID(0), Texture(0), NumVertices(0)
{
};

~RocketSFMLRendererGeometryHandler()
{
if(VertexID)
glDeleteBuffers(1, &VertexID);

if(IndexID)
glDeleteBuffers(1, &IndexID);

VertexID = IndexID = 0;
};
};

#endif

struct RocketSFMLRendererVertex
{
sf::Vector2f Position, TexCoord;
sf::Color Color;
};

RocketSFMLRenderer::RocketSFMLRenderer()
{
}

void RocketSFMLRenderer::SetWindow(sf::RenderWindow *Window)
{
MyWindow = Window;

Resize();
};

sf::RenderWindow *RocketSFMLRenderer::GetWindow()
{
return MyWindow;
};

void RocketSFMLRenderer::Resize()
{
MyWindow->setActive(true);


sf::View View(sf::FloatRect(0, 0, (float)MyWindow->getSize().x, (float)MyWindow->getSize().y));
MyWindow->setView(View);

MyWindow->popGLStates();
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
glOrtho(0, MyWindow->getSize().x, MyWindow->getSize().y, 0, -1, 1);
glMatrixMode(GL_MODELVIEW);

glViewport(0, 0, MyWindow->getSize().x, MyWindow->getSize().y);
MyWindow->pushGLStates();
   
};

// Called by Rocket when it wants to render geometry that it does not wish to optimise.
void RocketSFMLRenderer::RenderGeometry(Rocket::Core::Vertex* vertices, int num_vertices, int* indices, int num_indices, const Rocket::Core::TextureHandle texture, const Rocket::Core::Vector2f& translation)
{
MyWindow->setActive();

glPushMatrix();
glTranslatef(translation.x, translation.y, 0);

std::vector<Rocket::Core::Vector2f> Positions(num_vertices);
std::vector<Rocket::Core::Colourb> Colors(num_vertices);
std::vector<Rocket::Core::Vector2f> TexCoords(num_vertices);

for(int  i = 0; i < num_vertices; i++)
{
Positions[i] = vertices[i].position;
Colors[i] = vertices[i].colour;
TexCoords[i] = vertices[i].tex_coord;
};

glEnableClientState(GL_VERTEX_ARRAY);
glEnableClientState(GL_COLOR_ARRAY);
glEnableClientState(GL_TEXTURE_COORD_ARRAY);

glVertexPointer(2, GL_FLOAT, 0, &Positions[0]);
glColorPointer(4, GL_UNSIGNED_BYTE, 0, &Colors[0]);
glTexCoordPointer(2, GL_FLOAT, 0, &TexCoords[0]);

glEnable(GL_BLEND);
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);

sf::Texture *image = (sf::Texture*)texture;

if(image)
{
image->bind();
}
else
{
glDisableClientState(GL_TEXTURE_COORD_ARRAY);
glBindTexture(GL_TEXTURE_2D, 0);
};

glDrawElements(GL_TRIANGLES, num_indices, GL_UNSIGNED_INT, indices);

glDisableClientState(GL_VERTEX_ARRAY);
glDisableClientState(GL_COLOR_ARRAY);
glDisableClientState(GL_TEXTURE_COORD_ARRAY);

glColor4f(1, 1, 1, 1);

glPopMatrix();
}

// Called by Rocket when it wants to compile geometry it believes will be static for the forseeable future.
Rocket::Core::CompiledGeometryHandle RocketSFMLRenderer::CompileGeometry(Rocket::Core::Vertex* vertices,
   int num_vertices, int* indices,
   int num_indices,
   const Rocket::Core::TextureHandle texture)
{
#ifdef ENABLE_GLEE
MyWindow->SetActive();

if(!GLEE_VERSION_2_0)
return (Rocket::Core::CompiledGeometryHandle) NULL;

std::vector<RocketSFMLRendererVertex> Data(num_vertices);

for(unsigned long i = 0; i < Data.size(); i++)
{
Data[i].Position = *(sf::Vector2f*)&vertices[i].position;
Data[i].TexCoord = *(sf::Vector2f*)&vertices[i].tex_coord;
Data[i].Color = sf::Color(vertices[i].colour.red, vertices[i].colour.green,
vertices[i].colour.blue, vertices[i].colour.alpha);
};

RocketSFMLRendererGeometryHandler *Geometry = new RocketSFMLRendererGeometryHandler();
Geometry->NumVertices = num_indices;

glGenBuffers(1, &Geometry->VertexID);
glBindBuffer(GL_ARRAY_BUFFER, Geometry->VertexID);
glBufferData(GL_ARRAY_BUFFER, sizeof(RocketSFMLRendererVertex) * num_vertices, &Data[0],
GL_STATIC_DRAW);

glGenBuffers(1, &Geometry->IndexID);
glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, Geometry->IndexID);
glBufferData(GL_ELEMENT_ARRAY_BUFFER, sizeof(int) * num_indices, indices, GL_STATIC_DRAW);

glBindBuffer(GL_ARRAY_BUFFER, 0);

Geometry->Texture = texture;

return (Rocket::Core::CompiledGeometryHandle)Geometry;
#else
return NULL;
#endif
}

// Called by Rocket when it wants to render application-compiled geometry.
void RocketSFMLRenderer::RenderCompiledGeometry(Rocket::Core::CompiledGeometryHandle geometry, const Rocket::Core::Vector2f& translation)
{
#ifdef ENABLE_GLEE
MyWindow->setActive();

RocketSFMLRendererGeometryHandler *RealGeometry = (RocketSFMLRendererGeometryHandler *)geometry;

glPushMatrix();
glTranslatef(translation.x, translation.y, 0);
glEnable(GL_BLEND);
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);

sf::Texture *image = (sf::Texture *)RealGeometry->Texture;

if(image)
{
image->bind();
}
else
{
glBindTexture(GL_TEXTURE_2D, 0);
};

glEnable(GL_VERTEX_ARRAY);
glEnable(GL_TEXTURE_COORD_ARRAY);
glEnable(GL_COLOR_ARRAY);

#define BUFFER_OFFSET(x) ((char*)0 + x)

glBindBuffer(GL_ARRAY_BUFFER, RealGeometry->VertexID);
glVertexPointer(2, GL_FLOAT, sizeof(RocketSFMLRendererVertex), BUFFER_OFFSET(0));
glTexCoordPointer(2, GL_FLOAT, sizeof(RocketSFMLRendererVertex), BUFFER_OFFSET(sizeof(sf::Vector2f)));
glColorPointer(4, GL_UNSIGNED_BYTE, sizeof(RocketSFMLRendererVertex), BUFFER_OFFSET(sizeof(sf::Vector2f[2])));

glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, RealGeometry->IndexID);
glDrawElements(GL_TRIANGLES, RealGeometry->NumVertices, GL_UNSIGNED_INT, BUFFER_OFFSET(0));

glBindBuffer(GL_ARRAY_BUFFER, 0);

glDisable(GL_COLOR_ARRAY);
glDisable(GL_TEXTURE_COORD_ARRAY);
glDisable(GL_VERTEX_ARRAY);

glColor4f(1, 1, 1, 1);

glPopMatrix();
#else
ROCKET_ASSERT(false & "Not Implemented");
#endif
}

// Called by Rocket when it wants to release application-compiled geometry.
void RocketSFMLRenderer::ReleaseCompiledGeometry(Rocket::Core::CompiledGeometryHandle geometry)
{
#ifdef ENABLE_GLEE
MyWindow->SetActive();

delete (RocketSFMLRendererGeometryHandler *)geometry;
#else
ROCKET_ASSERT(false & "Not Implemented");
#endif
}

// Called by Rocket when it wants to enable or disable scissoring to clip content.
void RocketSFMLRenderer::EnableScissorRegion(bool enable)
{
MyWindow->setActive();

if (enable)
glEnable(GL_SCISSOR_TEST);
else
glDisable(GL_SCISSOR_TEST);
}

// Called by Rocket when it wants to change the scissor region.
void RocketSFMLRenderer::SetScissorRegion(int x, int y, int width, int height)
{
MyWindow->setActive();

glScissor(x, MyWindow->getSize().y - (y + height), width, height);
}

// Called by Rocket when a texture is required by the library.
bool RocketSFMLRenderer::LoadTexture(Rocket::Core::TextureHandle& texture_handle, Rocket::Core::Vector2i& texture_dimensions, const Rocket::Core::String& source)
{
MyWindow->setActive();

Rocket::Core::FileInterface* file_interface = Rocket::Core::GetFileInterface();
Rocket::Core::FileHandle file_handle = file_interface->Open(source);
if (file_handle == NULL)
return false;

file_interface->Seek(file_handle, 0, SEEK_END);
size_t buffer_size = file_interface->Tell(file_handle);
file_interface->Seek(file_handle, 0, SEEK_SET);

char* buffer = new char[buffer_size];
file_interface->Read(buffer, buffer_size, file_handle);
file_interface->Close(file_handle);

sf::Texture *image = new sf::Texture();

if(!image->loadFromMemory(buffer, buffer_size))
{
delete buffer;
delete image;

return false;
};
delete buffer;

texture_handle = (Rocket::Core::TextureHandle) image;
texture_dimensions = Rocket::Core::Vector2i(image->getSize().x, image->getSize().y);

return true;
}

// Called by Rocket when a texture is required to be built from an internally-generated sequence of pixels.
bool RocketSFMLRenderer::GenerateTexture(Rocket::Core::TextureHandle& texture_handle, const Rocket::Core::byte* source, const Rocket::Core::Vector2i& source_dimensions)
{
MyWindow->setActive();

sf::Texture *image = new sf::Texture();

image->create(source_dimensions.x, source_dimensions.y);
image->update(source);

texture_handle = (Rocket::Core::TextureHandle)image;

return true;
}

// Called by Rocket when a loaded texture is no longer required.
void RocketSFMLRenderer::ReleaseTexture(Rocket::Core::TextureHandle texture_handle)
{
MyWindow->setActive();

delete (sf::Texture *)texture_handle;
}

And the systemInterface:

Code: [Select]
/*
 * This source file is part of libRocket, the HTML/CSS Interface Middleware
 *
 * For the latest information, see http://www.librocket.com
 *
 * Copyright (c) 2008-2010 Nuno Silva
 *
 * Permission is hereby granted, free of charge, to any person obtaining a copy
 * of this software and associated documentation files (the "Software"), to deal
 * in the Software without restriction, including without limitation the rights
 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
 * copies of the Software, and to permit persons to whom the Software is
 * furnished to do so, subject to the following conditions:
 *
 * The above copyright notice and this permission notice shall be included in
 * all copies or substantial portions of the Software.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
 * THE SOFTWARE.
 *
 */
#include <Rocket/Core.h>
#include "SystemInterfaceSFML.h"

int RocketSFMLSystemInterface::GetKeyModifiers(sf::Window *Window)
{
int Modifiers = 0;

if(sf::Keyboard::isKeyPressed(sf::Keyboard::LShift) ||
sf::Keyboard::isKeyPressed(sf::Keyboard::RShift))
Modifiers |= Rocket::Core::Input::KM_SHIFT;

if(sf::Keyboard::isKeyPressed(sf::Keyboard::LControl) ||
sf::Keyboard::isKeyPressed(sf::Keyboard::RControl))
Modifiers |= Rocket::Core::Input::KM_CTRL;

if(sf::Keyboard::isKeyPressed(sf::Keyboard::LAlt) ||
sf::Keyboard::isKeyPressed(sf::Keyboard::RAlt))
Modifiers |= Rocket::Core::Input::KM_ALT;

return Modifiers;
};

Rocket::Core::Input::KeyIdentifier RocketSFMLSystemInterface::TranslateKey(sf::Keyboard::Key Key)
{
switch(Key)
{
case sf::Keyboard::A:
return Rocket::Core::Input::KI_A;
break;
case sf::Keyboard::B:
return Rocket::Core::Input::KI_B;
break;
case sf::Keyboard::C:
return Rocket::Core::Input::KI_C;
break;
case sf::Keyboard::D:
return Rocket::Core::Input::KI_D;
break;
case sf::Keyboard::E:
return Rocket::Core::Input::KI_E;
break;
case sf::Keyboard::F:
return Rocket::Core::Input::KI_F;
break;
case sf::Keyboard::G:
return Rocket::Core::Input::KI_G;
break;
case sf::Keyboard::H:
return Rocket::Core::Input::KI_H;
break;
case sf::Keyboard::I:
return Rocket::Core::Input::KI_I;
break;
case sf::Keyboard::J:
return Rocket::Core::Input::KI_J;
break;
case sf::Keyboard::K:
return Rocket::Core::Input::KI_K;
break;
case sf::Keyboard::L:
return Rocket::Core::Input::KI_L;
break;
case sf::Keyboard::M:
return Rocket::Core::Input::KI_M;
break;
case sf::Keyboard::N:
return Rocket::Core::Input::KI_N;
break;
case sf::Keyboard::O:
return Rocket::Core::Input::KI_O;
break;
case sf::Keyboard::P:
return Rocket::Core::Input::KI_P;
break;
case sf::Keyboard::Q:
return Rocket::Core::Input::KI_Q;
break;
case sf::Keyboard::R:
return Rocket::Core::Input::KI_R;
break;
case sf::Keyboard::S:
return Rocket::Core::Input::KI_S;
break;
case sf::Keyboard::T:
return Rocket::Core::Input::KI_T;
break;
case sf::Keyboard::U:
return Rocket::Core::Input::KI_U;
break;
case sf::Keyboard::V:
return Rocket::Core::Input::KI_V;
break;
case sf::Keyboard::W:
return Rocket::Core::Input::KI_W;
break;
case sf::Keyboard::X:
return Rocket::Core::Input::KI_X;
break;
case sf::Keyboard::Y:
return Rocket::Core::Input::KI_Y;
break;
case sf::Keyboard::Z:
return Rocket::Core::Input::KI_Z;
break;
case sf::Keyboard::Num0:
return Rocket::Core::Input::KI_0;
break;
case sf::Keyboard::Num1:
return Rocket::Core::Input::KI_1;
break;
case sf::Keyboard::Num2:
return Rocket::Core::Input::KI_2;
break;
case sf::Keyboard::Num3:
return Rocket::Core::Input::KI_3;
break;
case sf::Keyboard::Num4:
return Rocket::Core::Input::KI_4;
break;
case sf::Keyboard::Num5:
return Rocket::Core::Input::KI_5;
break;
case sf::Keyboard::Num6:
return Rocket::Core::Input::KI_6;
break;
case sf::Keyboard::Num7:
return Rocket::Core::Input::KI_7;
break;
case sf::Keyboard::Num8:
return Rocket::Core::Input::KI_8;
break;
case sf::Keyboard::Num9:
return Rocket::Core::Input::KI_9;
break;
case sf::Keyboard::Numpad0:
return Rocket::Core::Input::KI_NUMPAD0;
break;
case sf::Keyboard::Numpad1:
return Rocket::Core::Input::KI_NUMPAD1;
break;
case sf::Keyboard::Numpad2:
return Rocket::Core::Input::KI_NUMPAD2;
break;
case sf::Keyboard::Numpad3:
return Rocket::Core::Input::KI_NUMPAD3;
break;
case sf::Keyboard::Numpad4:
return Rocket::Core::Input::KI_NUMPAD4;
break;
case sf::Keyboard::Numpad5:
return Rocket::Core::Input::KI_NUMPAD5;
break;
case sf::Keyboard::Numpad6:
return Rocket::Core::Input::KI_NUMPAD6;
break;
case sf::Keyboard::Numpad7:
return Rocket::Core::Input::KI_NUMPAD7;
break;
case sf::Keyboard::Numpad8:
return Rocket::Core::Input::KI_NUMPAD8;
break;
case sf::Keyboard::Numpad9:
return Rocket::Core::Input::KI_NUMPAD9;
break;
case sf::Keyboard::Left:
return Rocket::Core::Input::KI_LEFT;
break;
case sf::Keyboard::Right:
return Rocket::Core::Input::KI_RIGHT;
break;
case sf::Keyboard::Up:
return Rocket::Core::Input::KI_UP;
break;
case sf::Keyboard::Down:
return Rocket::Core::Input::KI_DOWN;
break;
case sf::Keyboard::Add:
return Rocket::Core::Input::KI_ADD;
break;
case sf::Keyboard::Back:
return Rocket::Core::Input::KI_BACK;
break;
case sf::Keyboard::Delete:
return Rocket::Core::Input::KI_DELETE;
break;
case sf::Keyboard::Divide:
return Rocket::Core::Input::KI_DIVIDE;
break;
case sf::Keyboard::End:
return Rocket::Core::Input::KI_END;
break;
case sf::Keyboard::Escape:
return Rocket::Core::Input::KI_ESCAPE;
break;
case sf::Keyboard::F1:
return Rocket::Core::Input::KI_F1;
break;
case sf::Keyboard::F2:
return Rocket::Core::Input::KI_F2;
break;
case sf::Keyboard::F3:
return Rocket::Core::Input::KI_F3;
break;
case sf::Keyboard::F4:
return Rocket::Core::Input::KI_F4;
break;
case sf::Keyboard::F5:
return Rocket::Core::Input::KI_F5;
break;
case sf::Keyboard::F6:
return Rocket::Core::Input::KI_F6;
break;
case sf::Keyboard::F7:
return Rocket::Core::Input::KI_F7;
break;
case sf::Keyboard::F8:
return Rocket::Core::Input::KI_F8;
break;
case sf::Keyboard::F9:
return Rocket::Core::Input::KI_F9;
break;
case sf::Keyboard::F10:
return Rocket::Core::Input::KI_F10;
break;
case sf::Keyboard::F11:
return Rocket::Core::Input::KI_F11;
break;
case sf::Keyboard::F12:
return Rocket::Core::Input::KI_F12;
break;
case sf::Keyboard::F13:
return Rocket::Core::Input::KI_F13;
break;
case sf::Keyboard::F14:
return Rocket::Core::Input::KI_F14;
break;
case sf::Keyboard::F15:
return Rocket::Core::Input::KI_F15;
break;
case sf::Keyboard::Home:
return Rocket::Core::Input::KI_HOME;
break;
case sf::Keyboard::Insert:
return Rocket::Core::Input::KI_INSERT;
break;
case sf::Keyboard::LControl:
return Rocket::Core::Input::KI_LCONTROL;
break;
case sf::Keyboard::LShift:
return Rocket::Core::Input::KI_LSHIFT;
break;
case sf::Keyboard::Multiply:
return Rocket::Core::Input::KI_MULTIPLY;
break;
case sf::Keyboard::Pause:
return Rocket::Core::Input::KI_PAUSE;
break;
case sf::Keyboard::RControl:
return Rocket::Core::Input::KI_RCONTROL;
break;
case sf::Keyboard::Return:
return Rocket::Core::Input::KI_RETURN;
break;
case sf::Keyboard::RShift:
return Rocket::Core::Input::KI_RSHIFT;
break;
case sf::Keyboard::Space:
return Rocket::Core::Input::KI_SPACE;
break;
case sf::Keyboard::Subtract:
return Rocket::Core::Input::KI_SUBTRACT;
break;
case sf::Keyboard::Tab:
return Rocket::Core::Input::KI_TAB;
break;
};

return Rocket::Core::Input::KI_UNKNOWN;
};

float RocketSFMLSystemInterface::GetElapsedTime()
{
return timer.getElapsedTime().asSeconds();
};

bool RocketSFMLSystemInterface::LogMessage(Rocket::Core::Log::Type type, const Rocket::Core::String& message)
{
std::string Type;

switch(type)
{
case Rocket::Core::Log::LT_ALWAYS:
Type = "[Always]";
break;
case Rocket::Core::Log::LT_ERROR:
Type = "[Error]";
break;
case Rocket::Core::Log::LT_ASSERT:
Type = "[Assert]";
break;
case Rocket::Core::Log::LT_WARNING:
Type = "[Warning]";
break;
case Rocket::Core::Log::LT_INFO:
Type = "[Info]";
break;
case Rocket::Core::Log::LT_DEBUG:
Type = "[Debug]";
break;
};

printf("%s - %s\n", Type.c_str(), message.CString());

return true;
};

And this is the original 1.6:
Code: [Select]
/*
 * This source file is part of libRocket, the HTML/CSS Interface Middleware
 *
 * For the latest information, see http://www.librocket.com
 *
 * Copyright (c) 2008-2010 Nuno Silva
 *
 * Permission is hereby granted, free of charge, to any person obtaining a copy
 * of this software and associated documentation files (the "Software"), to deal
 * in the Software without restriction, including without limitation the rights
 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
 * copies of the Software, and to permit persons to whom the Software is
 * furnished to do so, subject to the following conditions:
 *
 * The above copyright notice and this permission notice shall be included in
 * all copies or substantial portions of the Software.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
 * THE SOFTWARE.
 *
 */

#include <Rocket/Core/Core.h>
#include "RenderInterfaceSFML.h"
#include <GL/gl.h>

#define GL_CLAMP_TO_EDGE 0x812F

// If built with the GL Easy Extension library we can compile geometry to VBO's
// http://www.opengl.org/sdk/libs/GLee/
#ifdef ENABLE_GLEE
#include <GL/glee.h>

class RocketSFMLRendererGeometryHandler
{
public:
GLuint VertexID, IndexID;
int NumVertices;
Rocket::Core::TextureHandle Texture;

RocketSFMLRendererGeometryHandler() : VertexID(0), IndexID(0), Texture(0), NumVertices(0)
{
};

~RocketSFMLRendererGeometryHandler()
{
if(VertexID)
glDeleteBuffers(1, &VertexID);

if(IndexID)
glDeleteBuffers(1, &IndexID);

VertexID = IndexID = 0;
};
};

#endif

struct RocketSFMLRendererVertex
{
sf::Vector2f Position, TexCoord;
sf::Color Color;
};

RocketSFMLRenderer::RocketSFMLRenderer()
{
}

void RocketSFMLRenderer::SetWindow(sf::RenderWindow *Window)
{
MyWindow = Window;

Resize();
};

sf::RenderWindow *RocketSFMLRenderer::GetWindow()
{
return MyWindow;
};

void RocketSFMLRenderer::Resize()
{
MyWindow->SetActive(true);
MyWindow->PreserveOpenGLStates(true);

static sf::View View;
View.SetFromRect(sf::FloatRect(0, (float)MyWindow->GetWidth(), (float)MyWindow->GetHeight(), 0));
MyWindow->SetView(View);

glMatrixMode(GL_PROJECTION);
glLoadIdentity();
glOrtho(0, MyWindow->GetWidth(), MyWindow->GetHeight(), 0, -1, 1);
glMatrixMode(GL_MODELVIEW);

glViewport(0, 0, MyWindow->GetWidth(), MyWindow->GetHeight());
};

// Called by Rocket when it wants to render geometry that it does not wish to optimise.
void RocketSFMLRenderer::RenderGeometry(Rocket::Core::Vertex* vertices, int num_vertices, int* indices, int num_indices, const Rocket::Core::TextureHandle texture, const Rocket::Core::Vector2f& translation)
{
MyWindow->SetActive();

glPushMatrix();
glTranslatef(translation.x, translation.y, 0);

std::vector<Rocket::Core::Vector2f> Positions(num_vertices);
std::vector<Rocket::Core::Colourb> Colors(num_vertices);
std::vector<Rocket::Core::Vector2f> TexCoords(num_vertices);

for(int  i = 0; i < num_vertices; i++)
{
Positions[i] = vertices[i].position;
Colors[i] = vertices[i].colour;
TexCoords[i] = vertices[i].tex_coord;
};

glEnableClientState(GL_VERTEX_ARRAY);
glEnableClientState(GL_COLOR_ARRAY);
glEnableClientState(GL_TEXTURE_COORD_ARRAY);

glVertexPointer(2, GL_FLOAT, 0, &Positions[0]);
glColorPointer(4, GL_UNSIGNED_BYTE, 0, &Colors[0]);
glTexCoordPointer(2, GL_FLOAT, 0, &TexCoords[0]);

glEnable(GL_BLEND);
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);

sf::Image *image = (sf::Image *)texture;

if(image)
{
image->Bind();
}
else
{
glDisableClientState(GL_TEXTURE_COORD_ARRAY);
glBindTexture(GL_TEXTURE_2D, 0);
};

glDrawElements(GL_TRIANGLES, num_indices, GL_UNSIGNED_INT, indices);

glDisableClientState(GL_VERTEX_ARRAY);
glDisableClientState(GL_COLOR_ARRAY);
glDisableClientState(GL_TEXTURE_COORD_ARRAY);

glColor4f(1, 1, 1, 1);

glPopMatrix();
}

// Called by Rocket when it wants to compile geometry it believes will be static for the forseeable future.
Rocket::Core::CompiledGeometryHandle RocketSFMLRenderer::CompileGeometry(Rocket::Core::Vertex* vertices,
   int num_vertices, int* indices,
   int num_indices,
   const Rocket::Core::TextureHandle texture)
{
#ifdef ENABLE_GLEE
MyWindow->SetActive();

if(!GLEE_VERSION_2_0)
return (Rocket::Core::CompiledGeometryHandle) NULL;

std::vector<RocketSFMLRendererVertex> Data(num_vertices);

for(unsigned long i = 0; i < Data.size(); i++)
{
Data[i].Position = *(sf::Vector2f*)&vertices[i].position;
Data[i].TexCoord = *(sf::Vector2f*)&vertices[i].tex_coord;
Data[i].Color = sf::Color(vertices[i].colour.red, vertices[i].colour.green,
vertices[i].colour.blue, vertices[i].colour.alpha);
};

RocketSFMLRendererGeometryHandler *Geometry = new RocketSFMLRendererGeometryHandler();
Geometry->NumVertices = num_indices;

glGenBuffers(1, &Geometry->VertexID);
glBindBuffer(GL_ARRAY_BUFFER, Geometry->VertexID);
glBufferData(GL_ARRAY_BUFFER, sizeof(RocketSFMLRendererVertex) * num_vertices, &Data[0],
GL_STATIC_DRAW);

glGenBuffers(1, &Geometry->IndexID);
glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, Geometry->IndexID);
glBufferData(GL_ELEMENT_ARRAY_BUFFER, sizeof(int) * num_indices, indices, GL_STATIC_DRAW);

glBindBuffer(GL_ARRAY_BUFFER, 0);

Geometry->Texture = texture;

return (Rocket::Core::CompiledGeometryHandle)Geometry;
#else
return NULL;
#endif
}

// Called by Rocket when it wants to render application-compiled geometry.
void RocketSFMLRenderer::RenderCompiledGeometry(Rocket::Core::CompiledGeometryHandle geometry, const Rocket::Core::Vector2f& translation)
{
#ifdef ENABLE_GLEE
MyWindow->SetActive();

RocketSFMLRendererGeometryHandler *RealGeometry = (RocketSFMLRendererGeometryHandler *)geometry;

glPushMatrix();
glTranslatef(translation.x, translation.y, 0);
glEnable(GL_BLEND);
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);

sf::Image *image = (sf::Image *)RealGeometry->Texture;

if(image)
{
image->Bind();
}
else
{
glBindTexture(GL_TEXTURE_2D, 0);
};

glEnable(GL_VERTEX_ARRAY);
glEnable(GL_TEXTURE_COORD_ARRAY);
glEnable(GL_COLOR_ARRAY);

#define BUFFER_OFFSET(x) ((char*)0 + x)

glBindBuffer(GL_ARRAY_BUFFER, RealGeometry->VertexID);
glVertexPointer(2, GL_FLOAT, sizeof(RocketSFMLRendererVertex), BUFFER_OFFSET(0));
glTexCoordPointer(2, GL_FLOAT, sizeof(RocketSFMLRendererVertex), BUFFER_OFFSET(sizeof(sf::Vector2f)));
glColorPointer(4, GL_UNSIGNED_BYTE, sizeof(RocketSFMLRendererVertex), BUFFER_OFFSET(sizeof(sf::Vector2f[2])));

glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, RealGeometry->IndexID);
glDrawElements(GL_TRIANGLES, RealGeometry->NumVertices, GL_UNSIGNED_INT, BUFFER_OFFSET(0));

glBindBuffer(GL_ARRAY_BUFFER, 0);

glDisable(GL_COLOR_ARRAY);
glDisable(GL_TEXTURE_COORD_ARRAY);
glDisable(GL_VERTEX_ARRAY);

glColor4f(1, 1, 1, 1);

glPopMatrix();
#else
ROCKET_ASSERT(false & "Not Implemented");
#endif
}

// Called by Rocket when it wants to release application-compiled geometry.
void RocketSFMLRenderer::ReleaseCompiledGeometry(Rocket::Core::CompiledGeometryHandle geometry)
{
#ifdef ENABLE_GLEE
MyWindow->SetActive();

delete (RocketSFMLRendererGeometryHandler *)geometry;
#else
ROCKET_ASSERT(false & "Not Implemented");
#endif
}

// Called by Rocket when it wants to enable or disable scissoring to clip content.
void RocketSFMLRenderer::EnableScissorRegion(bool enable)
{
MyWindow->SetActive();

if (enable)
glEnable(GL_SCISSOR_TEST);
else
glDisable(GL_SCISSOR_TEST);
}

// Called by Rocket when it wants to change the scissor region.
void RocketSFMLRenderer::SetScissorRegion(int x, int y, int width, int height)
{
MyWindow->SetActive();

glScissor(x, MyWindow->GetHeight() - (y + height), width, height);
}

// Called by Rocket when a texture is required by the library.
bool RocketSFMLRenderer::LoadTexture(Rocket::Core::TextureHandle& texture_handle, Rocket::Core::Vector2i& texture_dimensions, const Rocket::Core::String& source)
{
MyWindow->SetActive();

Rocket::Core::FileInterface* file_interface = Rocket::Core::GetFileInterface();
Rocket::Core::FileHandle file_handle = file_interface->Open(source);
if (file_handle == NULL)
return false;

file_interface->Seek(file_handle, 0, SEEK_END);
size_t buffer_size = file_interface->Tell(file_handle);
file_interface->Seek(file_handle, 0, SEEK_SET);

char* buffer = new char[buffer_size];
file_interface->Read(buffer, buffer_size, file_handle);
file_interface->Close(file_handle);

sf::Image *image = new sf::Image();

if(!image->LoadFromMemory(buffer, buffer_size))
{
delete buffer;
delete image;

return false;
};
delete buffer;

texture_handle = (Rocket::Core::TextureHandle) image;
texture_dimensions = Rocket::Core::Vector2i(image->GetWidth(), image->GetHeight());

return true;
}

// Called by Rocket when a texture is required to be built from an internally-generated sequence of pixels.
bool RocketSFMLRenderer::GenerateTexture(Rocket::Core::TextureHandle& texture_handle, const Rocket::Core::byte* source, const Rocket::Core::Vector2i& source_dimensions)
{
MyWindow->SetActive();

sf::Image *image = new sf::Image();

if(!image->LoadFromPixels(source_dimensions.x, source_dimensions.y, source))
{
delete image;

return false;
};

texture_handle = (Rocket::Core::TextureHandle)image;

return true;
}

// Called by Rocket when a loaded texture is no longer required.
void RocketSFMLRenderer::ReleaseTexture(Rocket::Core::TextureHandle texture_handle)
{
MyWindow->SetActive();

delete (sf::Image *)texture_handle;
}

and

Code: [Select]
/*
 * This source file is part of libRocket, the HTML/CSS Interface Middleware
 *
 * For the latest information, see http://www.librocket.com
 *
 * Copyright (c) 2008-2010 Nuno Silva
 *
 * Permission is hereby granted, free of charge, to any person obtaining a copy
 * of this software and associated documentation files (the "Software"), to deal
 * in the Software without restriction, including without limitation the rights
 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
 * copies of the Software, and to permit persons to whom the Software is
 * furnished to do so, subject to the following conditions:
 *
 * The above copyright notice and this permission notice shall be included in
 * all copies or substantial portions of the Software.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
 * THE SOFTWARE.
 *
 */
#include <Rocket/Core.h>
#include "SystemInterfaceSFML.h"

int RocketSFMLSystemInterface::GetKeyModifiers(sf::Window *Window)
{
int Modifiers = 0;

if(Window->GetInput().IsKeyDown(sf::Key::LShift) ||
Window->GetInput().IsKeyDown(sf::Key::RShift))
Modifiers |= Rocket::Core::Input::KM_SHIFT;

if(Window->GetInput().IsKeyDown(sf::Key::LControl) ||
Window->GetInput().IsKeyDown(sf::Key::RControl))
Modifiers |= Rocket::Core::Input::KM_CTRL;

if(Window->GetInput().IsKeyDown(sf::Key::LAlt) ||
Window->GetInput().IsKeyDown(sf::Key::RAlt))
Modifiers |= Rocket::Core::Input::KM_ALT;

return Modifiers;
};

Rocket::Core::Input::KeyIdentifier RocketSFMLSystemInterface::TranslateKey(sf::Key::Code Key)
{
switch(Key)
{
case sf::Key::A:
return Rocket::Core::Input::KI_A;
break;
case sf::Key::B:
return Rocket::Core::Input::KI_B;
break;
case sf::Key::C:
return Rocket::Core::Input::KI_C;
break;
case sf::Key::D:
return Rocket::Core::Input::KI_D;
break;
case sf::Key::E:
return Rocket::Core::Input::KI_E;
break;
case sf::Key::F:
return Rocket::Core::Input::KI_F;
break;
case sf::Key::G:
return Rocket::Core::Input::KI_G;
break;
case sf::Key::H:
return Rocket::Core::Input::KI_H;
break;
case sf::Key::I:
return Rocket::Core::Input::KI_I;
break;
case sf::Key::J:
return Rocket::Core::Input::KI_J;
break;
case sf::Key::K:
return Rocket::Core::Input::KI_K;
break;
case sf::Key::L:
return Rocket::Core::Input::KI_L;
break;
case sf::Key::M:
return Rocket::Core::Input::KI_M;
break;
case sf::Key::N:
return Rocket::Core::Input::KI_N;
break;
case sf::Key::O:
return Rocket::Core::Input::KI_O;
break;
case sf::Key::P:
return Rocket::Core::Input::KI_P;
break;
case sf::Key::Q:
return Rocket::Core::Input::KI_Q;
break;
case sf::Key::R:
return Rocket::Core::Input::KI_R;
break;
case sf::Key::S:
return Rocket::Core::Input::KI_S;
break;
case sf::Key::T:
return Rocket::Core::Input::KI_T;
break;
case sf::Key::U:
return Rocket::Core::Input::KI_U;
break;
case sf::Key::V:
return Rocket::Core::Input::KI_V;
break;
case sf::Key::W:
return Rocket::Core::Input::KI_W;
break;
case sf::Key::X:
return Rocket::Core::Input::KI_X;
break;
case sf::Key::Y:
return Rocket::Core::Input::KI_Y;
break;
case sf::Key::Z:
return Rocket::Core::Input::KI_Z;
break;
case sf::Key::Num0:
return Rocket::Core::Input::KI_0;
break;
case sf::Key::Num1:
return Rocket::Core::Input::KI_1;
break;
case sf::Key::Num2:
return Rocket::Core::Input::KI_2;
break;
case sf::Key::Num3:
return Rocket::Core::Input::KI_3;
break;
case sf::Key::Num4:
return Rocket::Core::Input::KI_4;
break;
case sf::Key::Num5:
return Rocket::Core::Input::KI_5;
break;
case sf::Key::Num6:
return Rocket::Core::Input::KI_6;
break;
case sf::Key::Num7:
return Rocket::Core::Input::KI_7;
break;
case sf::Key::Num8:
return Rocket::Core::Input::KI_8;
break;
case sf::Key::Num9:
return Rocket::Core::Input::KI_9;
break;
case sf::Key::Numpad0:
return Rocket::Core::Input::KI_NUMPAD0;
break;
case sf::Key::Numpad1:
return Rocket::Core::Input::KI_NUMPAD1;
break;
case sf::Key::Numpad2:
return Rocket::Core::Input::KI_NUMPAD2;
break;
case sf::Key::Numpad3:
return Rocket::Core::Input::KI_NUMPAD3;
break;
case sf::Key::Numpad4:
return Rocket::Core::Input::KI_NUMPAD4;
break;
case sf::Key::Numpad5:
return Rocket::Core::Input::KI_NUMPAD5;
break;
case sf::Key::Numpad6:
return Rocket::Core::Input::KI_NUMPAD6;
break;
case sf::Key::Numpad7:
return Rocket::Core::Input::KI_NUMPAD7;
break;
case sf::Key::Numpad8:
return Rocket::Core::Input::KI_NUMPAD8;
break;
case sf::Key::Numpad9:
return Rocket::Core::Input::KI_NUMPAD9;
break;
case sf::Key::Left:
return Rocket::Core::Input::KI_LEFT;
break;
case sf::Key::Right:
return Rocket::Core::Input::KI_RIGHT;
break;
case sf::Key::Up:
return Rocket::Core::Input::KI_UP;
break;
case sf::Key::Down:
return Rocket::Core::Input::KI_DOWN;
break;
case sf::Key::Add:
return Rocket::Core::Input::KI_ADD;
break;
case sf::Key::Back:
return Rocket::Core::Input::KI_BACK;
break;
case sf::Key::Delete:
return Rocket::Core::Input::KI_DELETE;
break;
case sf::Key::Divide:
return Rocket::Core::Input::KI_DIVIDE;
break;
case sf::Key::End:
return Rocket::Core::Input::KI_END;
break;
case sf::Key::Escape:
return Rocket::Core::Input::KI_ESCAPE;
break;
case sf::Key::F1:
return Rocket::Core::Input::KI_F1;
break;
case sf::Key::F2:
return Rocket::Core::Input::KI_F2;
break;
case sf::Key::F3:
return Rocket::Core::Input::KI_F3;
break;
case sf::Key::F4:
return Rocket::Core::Input::KI_F4;
break;
case sf::Key::F5:
return Rocket::Core::Input::KI_F5;
break;
case sf::Key::F6:
return Rocket::Core::Input::KI_F6;
break;
case sf::Key::F7:
return Rocket::Core::Input::KI_F7;
break;
case sf::Key::F8:
return Rocket::Core::Input::KI_F8;
break;
case sf::Key::F9:
return Rocket::Core::Input::KI_F9;
break;
case sf::Key::F10:
return Rocket::Core::Input::KI_F10;
break;
case sf::Key::F11:
return Rocket::Core::Input::KI_F11;
break;
case sf::Key::F12:
return Rocket::Core::Input::KI_F12;
break;
case sf::Key::F13:
return Rocket::Core::Input::KI_F13;
break;
case sf::Key::F14:
return Rocket::Core::Input::KI_F14;
break;
case sf::Key::F15:
return Rocket::Core::Input::KI_F15;
break;
case sf::Key::Home:
return Rocket::Core::Input::KI_HOME;
break;
case sf::Key::Insert:
return Rocket::Core::Input::KI_INSERT;
break;
case sf::Key::LControl:
return Rocket::Core::Input::KI_LCONTROL;
break;
case sf::Key::LShift:
return Rocket::Core::Input::KI_LSHIFT;
break;
case sf::Key::Multiply:
return Rocket::Core::Input::KI_MULTIPLY;
break;
case sf::Key::Pause:
return Rocket::Core::Input::KI_PAUSE;
break;
case sf::Key::RControl:
return Rocket::Core::Input::KI_RCONTROL;
break;
case sf::Key::Return:
return Rocket::Core::Input::KI_RETURN;
break;
case sf::Key::RShift:
return Rocket::Core::Input::KI_RSHIFT;
break;
case sf::Key::Space:
return Rocket::Core::Input::KI_SPACE;
break;
case sf::Key::Subtract:
return Rocket::Core::Input::KI_SUBTRACT;
break;
case sf::Key::Tab:
return Rocket::Core::Input::KI_TAB;
break;
};

return Rocket::Core::Input::KI_UNKNOWN;
};

float RocketSFMLSystemInterface::GetElapsedTime()
{
return timer.GetElapsedTime();
};

bool RocketSFMLSystemInterface::LogMessage(Rocket::Core::Log::Type type, const Rocket::Core::String& message)
{
std::string Type;

switch(type)
{
case Rocket::Core::Log::LT_ALWAYS:
Type = "[Always]";
break;
case Rocket::Core::Log::LT_ERROR:
Type = "[Error]";
break;
case Rocket::Core::Log::LT_ASSERT:
Type = "[Assert]";
break;
case Rocket::Core::Log::LT_WARNING:
Type = "[Warning]";
break;
case Rocket::Core::Log::LT_INFO:
Type = "[Info]";
break;
case Rocket::Core::Log::LT_DEBUG:
Type = "[Debug]";
break;
};

printf("%s - %s\n", Type.c_str(), message.CString());

return true;
};

I cant seem to see any thing else that needs chaning but maybe a new set of eyes might be able to spot something.

23
Graphics / SFML2 Texture/Image loadFroPixels
« on: May 03, 2012, 06:49:31 pm »
Im trying to convert the libRocket SFML renderer from 1.6 to 2.0 and I have done more or less everyhthing apart from the texture creation, the included SFML renderer uses the old loadFromPixels but I just wanted to know how you would do this in 2.0

24
Graphics / How to set texture for vertices array
« on: March 15, 2012, 01:36:57 pm »
Why use sf::Vertex* vert = new sf::Vertex[6];

And not just an sf::VertexArray?

25
Window / Changing to cartesian coordinates
« on: March 09, 2012, 01:43:15 am »
Hi, im trying to use Box2D with SFML however box2D uses cartesian coordinates but SFML uses inverted Y.
Is there any way to change the SFML coordinate system easily? say with the view class or something?

26
DotNet / get window position?
« on: March 02, 2012, 09:50:31 pm »
How do you get the window position?
I want to get the mouse position relative to the window but I need the window position to do this.

27
DotNet / SFML.Net GUI?
« on: March 01, 2012, 02:58:44 am »
Just wondering if there are any SFML.net GUI's that work with the current graphcs API?

28
Graphics / VertexArray's images picking up extra pixel
« on: February 29, 2012, 01:37:39 pm »
Quote from: "Laurent"
This can happen when the using decimal coordinates, or when the size of the view is not a multiple of the size of the window.


So i should use floats as the findow position and center?
And if the window is 640x640 then I can use 160 as the view size right?

29
Graphics / VertexArray's images picking up extra pixel
« on: February 28, 2012, 10:14:00 pm »
I moved my map from lots of sprites to just 1 vertex array and I was messing around with the window view making it follow the mouse(as in the future I will make it follow he player) and I get transparent lines at some positions.
this is the code:
Code: [Select]
SFML.Graphics.View view = new SFML.Graphics.View(new SFML.Window.Vector2f(wid/2.0f,80)
, new SFML.Window.Vector2f(wid,160));

window.SetView(view);


And this is what happens:



It seems to be picking up a line of pixels from the tile bellow it on the tilesheet

30
Feature requests / Batch Drawing
« on: February 27, 2012, 09:34:09 pm »
Just made a benchmark to test it out.

The C# code is:
Code: [Select]
public static void Main (string[] args)
{
RenderWindow window = new RenderWindow(new SFML.Window.VideoMode(800,600), "SFML TEST");
Sprite spr = new Sprite(new Texture("img.png") );
int startTime = 0;
int delta = 0;
int i = 111; //have an int to turn it into a string as the delta would be
for(int a = 0; a < 10; a++)
{
startTime = Environment.TickCount;
window.SetActive();

                window.Clear(SFML.Graphics.Color.White);
   
window.Draw(spr);
window.Draw(new SFML.Graphics.Text( i + " ms", SFML.Graphics.Font.DefaultFont, 12));
                // Finally, display the rendered frame on screen
                window.Display();
delta += (Environment.TickCount - startTime);
}

window.Close();
Console.WriteLine("Average in 10 runs is: " + (delta/10.0f) );
//Average output is around 79-80
}

With an average frame taking 79 to 80 ms to clear, draw an 800x600 image, draw the time & display it.

And C++ takes around the same to do the same... (well around 76 ms) So I guess my program is just because of the vertex array then.
Oh well Im ok with that I guess :)
On any decent computer it should run pretty fast.

The C++ code btw is:

Code: [Select]
#include <SFML/Graphics.hpp>
#include <iostream>
#include <sstream>

int main()
{
    sf::Clock clock;
    sf::Int32 delta = 0;
    sf::RenderWindow App;

    App.Create( sf::VideoMode(800,600,32), "Window");
    sf::Sprite spr;
    sf::Texture tex;
    tex.LoadFromFile("img.png");
    spr.SetTexture(tex);


    for(int i = 0; i < 10; i++)
    {
        clock.Restart().AsMilliseconds();

        App.SetActive();

        App.Clear(sf::Color::Black);

        App.Draw(spr);

        std::stringstream ss;
        ss << delta << " ms" << std::endl;
        sf::Text text( ss.str() );
        App.Draw(text);

        App.Display();
        delta += clock.Restart().AsMilliseconds();
    }
    std::cout << (delta/10.0f) << std::endl;
}


And the image I used is: http://i.imgur.com/UW5pm.jpg

Pages: 1 [2] 3 4 ... 13
anything