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

Pages: [1]
1
Feature requests / Applying shader effect to RenderTarget
« on: July 27, 2013, 10:17:25 pm »
Hi!

Sometimes is needed to apply shader effect to the scene, but now it's required to render all the scene with sf::RenderTexture, get this texture and render it again to window with shader. What do you think about add applyShaderEffect method for sf::RenderTarget? Or maybe something like sf::PostFX in SFML 1.6 - you can simply pass it as sf::Drawable?

Regards,
Mrowqa

2
Feature requests / Re: Geometry shader
« on: July 18, 2013, 11:28:44 pm »
I didn't think about it - I simply keep it. You're right, it doesn't make sense. I'll delete them then and update pull request :)

3
Feature requests / Re: Geometry shader
« on: July 18, 2013, 07:25:19 pm »
If someone needs this feature, you can find code here: https://github.com/Mrowqa/SFML/commit/321c806eae6a5bb412e127732c7b0955fa57b3ae
I've implemented it according to my previous idea and corrected the documentation ;) What do you, Laurent, think about it?

4
Feature requests / Re: Geometry shader
« on: July 15, 2013, 10:44:53 pm »
- I already have two loadFromXxx overloads to handle combinations of fragment/vertex shaders, supporting combinations of 3 would be impossible (or at least bloated) with this approach
It could be done like sf::RenderStates. You can keep method for one type of shader and write second method for all three types - if you don't want one of types you can simply pass empty string/stream.

- Sometimes vertex and fragment shaders are supported but not geometry shaders
Clean and easy:
static bool isAvailable (Type shaderType);

So I would most likely have to change the whole design, put each shader type into its own class.
No, you don't have to. Just use two previous ideas. If one of shader's type won't be supported - you simply fail loadFromXXX method - programmer should check which shaders are available before using them.

It's not difficult, is it? :) It won't limite functionality. On the contrary, it will expand library's possibilities. So? :)

5
Feature requests / Geometry shader
« on: July 14, 2013, 11:26:24 pm »
Hi!

Did you, Laurent, think about add support for geometry shader? I wanted to write dynamic shadows* in GLSL, but I realised that SFML doesn't support geometry shaders. Of course, I can compute it on CPU, but I'd like to learn GLSL and write something cool. Actually my only solution is use OpenGL to load shaders.

* of course there's much more situations, where it'd be helpful; I only wrote example from my life

Regards,
Mrowqa

6
General / Re: [CMake, MSVC, win8] Application crashes when it starts
« on: April 03, 2013, 07:51:28 pm »
The whole point being made by me, is that the example is too complicated for a beginner. If he has never worked with classes, he will have no idea what inheritance is and will have no idea, how this point thingy now suddenly works etc. He's missing the basic of C++, which is what a class is and talking about polymorphism is a topic, he might want to checkout later on, thus my questioning of the relevance of your post. ;)
Oh, I'm not so beginner :) I know some languages and libraries. My C++ knowledge maybe isn't the best (I've not recognized new C++11 standard library fully), but I know what are templates, exceptions, polymorphism or even v-table from assembly level. As I wrote previosly - I'm not professional programmer and I just don't know how to make good code - but I want to learn it. I have more difficulty with translating english - I'm just 16 ::)

7
General / Re: [CMake, MSVC, win8] Application crashes when it starts
« on: April 03, 2013, 08:19:41 am »
Good knowledge about language is base. I read really good book about C++ by George Grębosz some years ago, but people are learning all life :) I'll look for good book about code design. Thanks again ;)

8
General / Re: [CMake, MSVC, win8] Application crashes when it starts
« on: April 02, 2013, 09:50:33 pm »
As I wrote previously, I'm still learning. I didn't know that global/static variables are so bad for good code design. I've written one module for global managing resources (based on static variables), so there's long way to go through for me ::) Thanks for advice!

9
General / Re: [CMake, MSVC, win8] Application crashes when it starts
« on: April 02, 2013, 04:40:04 pm »
Thanks! Someday maybe I'll learn OpenGL, but now it doesn't make sens for me - there's SFML :)

Just use a better code design, that doesn't require globals, especially not ones like sf::RenderWindow. ;)
I wanna singleton for sf::RenderWindow (I'll make static pointer). I'm not professional programmer and I'm still learning how to make good code design :)

Nop, it's more complicated. It's because they are OpenGL resources.

Anyway: don't use globals!
App compiled by GCC works, so... It's strange for me for the time being. MSVC...

10
General / Re: [CMake, MSVC, win8] Application crashes when it starts
« on: April 02, 2013, 03:34:36 pm »
I know that I have static sf::RenderWindow - in global scope app can't create new object. I tested sf::Window, sf::RenderTexture, sf::Context, sf::Image and sf::Time too. Three first of them crashes app. That's probably sf::NonCopyable constructor's blame.

11
General / Re: [CMake, MSVC, win8] Application crashes when starting
« on: March 31, 2013, 12:01:52 pm »
I don't have global variables AFAIR, but I have many static (in class). Official repo: https://bitbucket.org/Mrowqa/cm-billiard - any of these modules haven't been using, but I compile all code. Actual CM_Billiard.cpp:
#include <iostream>
#include "CMBilliardConfig.h"
using namespace std;

int main2();

int main()
{
        cout << "Source code in development\n"
                        "Actual version: " << CM_BILLIARD_VERSION_MAJOR << "." << CM_BILLIARD_VERSION_MINOR << "." << CM_BILLIARD_VERSION_EXTRA_INFO << "\n";
        main2();
        return 0;
}

#include <SFML/Graphics.hpp>
#include <Box2D/Box2D.h>

int main2()
{
        b2World world(b2Vec2());
    sf::RenderWindow window(sf::VideoMode(200, 200), "SFML works!");
    sf::CircleShape shape(100.f);
    shape.setFillColor(sf::Color::Green);

    while (window.isOpen())
    {
        sf::Event event;
        while (window.pollEvent(event))
        {
            if (event.type == sf::Event::Closed)
                window.close();
        }

        window.clear();
        window.draw(shape);
        window.display();
    }

    return 0;
}
 

PS code on repositorium can't be compile by GCC. It works with MSVC (locally I corrected code, but not uploaded).

12
General / [CMake, MSVC, win8] Application crashes when it starts
« on: March 31, 2013, 11:27:00 am »
Hi!

I tried compile and run simply SFML application by MSVC and GCC and I have strange problem.

When I manually configured projects (Visual Studio 11 and CodeBlocks 12.11), app works. So, I wanted to add CMakeLists.txt to my current project and I got problem. When I generate makefiles/solution and compile app by GCC (static or dynamic linked) or Visual Studio dynamic linked, it works, but when I try generate Visual Studio 11 solution, compile it and run - I got this:
Debug: http://puu.sh/2r8eo
Release: http://puu.sh/2r8f8

I'm using win8 and SFML 9fac5d74dcef2e78b21c8500589ea9f8cf263fb3 (Jan 16, 2013). For finding SFML I'm using attached FindSFML.cmake:
# find SFML and add include path
set(SFML_STATIC_LIBRARIES TRUE)
find_package(SFML 2 COMPONENTS audio graphics window system REQUIRED)
include_directories(${SFML_INCLUDE_DIR})
# ...
# add the executable
add_executable(CM_Billiard ${CM_BILLIARD_SRC})
target_link_libraries(CM_Billiard ${SFML_LIBRARIES} ${BOX2D_LIBRARIES})
 

How to correct it?

Regards,
Mrowqa

Pages: [1]
anything