Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: New graphics API ready  (Read 82883 times)

0 Members and 1 Guest are viewing this topic.

Richy19

  • Full Member
  • ***
  • Posts: 190
    • View Profile
New graphics API ready
« Reply #90 on: December 14, 2011, 03:24:36 am »
just tried running the shader example but i get this:

Code: [Select]

./shader
Failed to compile fragment shader:
0:27(31): error: Could not implicitly convert operands to arithmetic operator
0:27(31): error: Operands to relational operators must be scalar and numeric
0:27(31): error: if-statement condition must be scalar boolean


Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32504
    • View Profile
    • SFML's website
    • Email
New graphics API ready
« Reply #91 on: December 14, 2011, 07:35:52 am »
It's hard to fix because I don't see this error on my computer. I tried something, can you tell me if the new code solves the problem?
Laurent Gomila - SFML developer

coolhome

  • Jr. Member
  • **
  • Posts: 59
    • View Profile
New graphics API ready
« Reply #92 on: December 14, 2011, 10:46:54 am »
The new API is looking promising! Congrats! However I'm really going to miss that sf::Sprite::GetSize().. oh well that's life! Looks like your long term planning might be paying off on this :D
CoderZilla - Everything Programming

Richy19

  • Full Member
  • ***
  • Posts: 190
    • View Profile
New graphics API ready
« Reply #93 on: December 14, 2011, 01:10:43 pm »
No error message on the shader example but the window just opens and closes now

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32504
    • View Profile
    • SFML's website
    • Email
New graphics API ready
« Reply #94 on: December 14, 2011, 01:13:57 pm »
Quote
No error message on the shader example but the window just opens and closes now

Strange. Would you mind running the debugger, and show me the call stack?
Laurent Gomila - SFML developer

Richy19

  • Full Member
  • ***
  • Posts: 190
    • View Profile
New graphics API ready
« Reply #95 on: December 15, 2011, 02:09:56 pm »
Code: [Select]
richy@R-Laptop:~/Desktop/LaurentGomila-SFML-78e1e87/make/examples/shader$ gdb ./shader
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/Desktop/LaurentGomila-SFML-78e1e87/make/examples/shader/shader...(no debugging symbols found)...done.
(gdb) run
Starting program: /home/richy/Desktop/LaurentGomila-SFML-78e1e87/make/examples/shader/shader
[Thread debugging using libthread_db enabled]
[Inferior 1 (process 4080) exited with code 01]
(gdb)


tried building the debug version but got this:
CMake Error at CMakeLists.txt:133 (add_subdirectory):
  add_subdirectory given source "examples" which is not an existing
  directory.

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32504
    • View Profile
    • SFML's website
    • Email
New graphics API ready
« Reply #96 on: December 15, 2011, 02:18:17 pm »
Quote
tried building the debug version but got this:
CMake Error at CMakeLists.txt:133 (add_subdirectory):
add_subdirectory given source "examples" which is not an existing
directory.

Hum. You probably did something wrong. Try to delete everything, download SFML again and compile it directly in debug mode.
Laurent Gomila - SFML developer

gsaurus

  • Sr. Member
  • ****
  • Posts: 262
    • View Profile
    • Evolution Engine
New graphics API ready
« Reply #97 on: December 15, 2011, 04:51:58 pm »
Anything I draw onto a RenderTexture isn't displayed.

Code: [Select]
   sf::RenderTexture texture;
    if (!texture.Create(300, 300)) return -1;

    sf::CircleShape circle(100);
    circle.SetFillColor(sf::Color::Green);

    texture.Clear(sf::Color::Blue);
    texture.Draw(circle);
    texture.Display(); // display the drawn circle

    while (window.IsOpened()){
        window.Clear();
        sf::Sprite sprite(texture.GetTexture());
        window.Draw(sprite);
        window.Display();
    }


Output: black screen with a blue square on top left; the green circle is missing.


Also, possibly a typo on documentation?
sf::RenderTexture::SetSmooth: This parameter is enabled by default.
sf::Texture::SetSmooth: The smooth filter is disabled by default.
Pluma - Plug-in Management Framework

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32504
    • View Profile
    • SFML's website
    • Email
New graphics API ready
« Reply #98 on: December 15, 2011, 08:47:54 pm »
Quote
Anything I draw onto a RenderTexture isn't displayed.

Would you mind providing a complete source code? I know that it's almost complete, but this evening I'm a little lazy and don't have much time ;)

Quote
Also, possibly a typo on documentation?
sf::RenderTexture::SetSmooth: This parameter is enabled by default.

Yes. Thanks.
Laurent Gomila - SFML developer

gsaurus

  • Sr. Member
  • ****
  • Posts: 262
    • View Profile
    • Evolution Engine
New graphics API ready
« Reply #99 on: December 15, 2011, 09:03:09 pm »
It's really just that :P

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

int main(){

    sf::RenderWindow window(sf::VideoMode(800, 600), "SFML window");

    sf::RenderTexture texture;
    if (!texture.Create(300, 300)) return EXIT_FAILURE;

    sf::CircleShape circle(100);
    circle.SetFillColor(sf::Color::Green);

    texture.Clear(sf::Color::Blue);
    texture.Draw(circle);
    texture.Display();

    sf::Event event;
    while (window.IsOpened()){
        while (window.PollEvent(event)){
            if (event.Type == sf::Event::Closed){
                window.Close();
            }
        }
        window.Clear();
        sf::Sprite sprite(texture.GetTexture());
        window.Draw(sprite);
        //window.Draw(circle);
        window.Display();
    }
    return EXIT_SUCCESS;
}
Pluma - Plug-in Management Framework

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32504
    • View Profile
    • SFML's website
    • Email
New graphics API ready
« Reply #100 on: December 15, 2011, 09:04:16 pm »
It works for me. Do you have an Intel integrated graphics chipset?
Laurent Gomila - SFML developer

gsaurus

  • Sr. Member
  • ****
  • Posts: 262
    • View Profile
    • Evolution Engine
New graphics API ready
« Reply #101 on: December 15, 2011, 09:08:52 pm »
ATI Mobility Radeon X1400
Pluma - Plug-in Management Framework

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32504
    • View Profile
    • SFML's website
    • Email
New graphics API ready
« Reply #102 on: December 15, 2011, 09:17:04 pm »
Are your drivers up-to-date?
Laurent Gomila - SFML developer

gsaurus

  • Sr. Member
  • ****
  • Posts: 262
    • View Profile
    • Evolution Engine
New graphics API ready
« Reply #103 on: December 16, 2011, 01:21:37 am »
After trying a lot seems that I couldn't get new drivers for my graphics card.. my guess is either due to ATI acquisition by AMD or this card being too old (5 years or so). It's not a bad time to think on a new computer.
Pluma - Plug-in Management Framework

Richy19

  • Full Member
  • ***
  • Posts: 190
    • View Profile
New graphics API ready
« Reply #104 on: December 17, 2011, 03:27:52 pm »
compiled the debug shader example and:

Code: [Select]
(gdb) run
Starting program: /home/richy/Desktop/SFML2a/examples/shader/shader-d
[Thread debugging using libthread_db enabled]
/home/richy/Desktop/SFML2a/examples/shader/shader-d: symbol lookup error: /home/richy/Desktop/SFML2a/examples/shader/shader-d: undefined symbol: _ZN2sf6ShaderC1ERKS0_
[Inferior 1 (process 12155) exited with code 0177]

 

anything