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

Pages: [1] 2
1
SFML projects / Re: Ptakopysk - C++ game prototyping framework
« on: August 31, 2014, 04:31:37 am »
Hi game developers!

After a long time of polishing IDE and framework, today i released (i hope) very stable version of Ptakopysk Toolset.

There was a lot of changes, mostly in IDE (like whole plugins management, including rewritten Scene View plugin template, and another small but very important changes to optimization). Framework got for example a new SpriteAtlas component and SpriteAtlasAsset that provides a way to use spritesheets in your games, and Assets manager now can handle custom assets defined by user (custom JSON/text/binary/whatevah files to use in your game, embedded in game bundle, editable in IDE).

And one great change – now you don’t need to have Bash executable to use IDE, whole Bash scripts dependency in IDE is removed and replaced by templates scripts that do the same thing as Bash scripts! :D

DOWNLOAD LATEST RELEASE TODAY: https://github.com/PsichiX/Ptakopysk/releases

2
SFML projects / Re: WideVM for particles
« on: August 27, 2014, 07:46:48 pm »
but that's what shader does right now - SFML uses GLSL on every supported platform, it uses the same syntax and functionality everywhere. even it optimize code for given GPU. it's doing the same what you did there and it's doing it better & faster :P

3
SFML projects / Re: WideVM for particles
« on: August 27, 2014, 08:24:09 am »
it's better to "script" particles in shader - it's hundreds times faster than c++, it's parallel and needs a lot of gpu knowledge, but it's definitely worth it :)

4
General / Re: Very High CPU Usage.
« on: August 19, 2014, 12:11:59 am »
and you have implemented fixed step or fps limit? because if not, main loop will draw every frame so it will consume whole available processing time.

5
good app to make spritesheets: Texture Packer.
good free app to make spritesheets: Sprite Sheet Packer for Starling.

6
Graphics / Re: Window from handle and shaders not available.
« on: August 18, 2014, 07:14:41 pm »
ok, i'va changed int to long in code that creates window and somehow shaders are now available :0 but now after loading shaders happens something weird - scene looks like default blend mode is set to none, so there is no more transparency, but i think i can fix that - thanks for solution!

edit: nope, i've added some line of code related to assets loading (just a setter of variable, nothing that touch shaders itself) before window creaton so problem is still not solved :>

7
Graphics / Re: Window from handle and shaders not available.
« on: August 18, 2014, 05:04:35 pm »
rdbuf was exactly what i needed! :) so i'm back to testing.

8
Graphics / Re: Window from handle and shaders not available.
« on: August 18, 2014, 04:52:27 pm »
i'm sure about window successful creation because rendering is working, textures are displayed, window has opened status, everything works but only shaders are not loaded because of sf::Shader::isAvailable() returns false. i've even added debug logs to file to get to know on what line exactly function fails and it was on sf::Shader::isAvailable() definitely.
Is there a way to get sfml logs string and put it into my logger? that should help me to get information what behind the scenes is happening.
btw. i will change int to long for window handle anyway, thanks for this info :)

@zsbzsb: it's a macro to enable memory tracing in my engine, but here is disabled so it's replaced by 'new' during compilation process.

9
Graphics / Re: Window from handle and shaders not available.
« on: August 18, 2014, 04:31:35 pm »
yes - window is created within .NET control Load event, then shaders are loaded when scene is opened in editor.

.NET class constructor:
public RendererSurfaceControl()
{
        Load += new EventHandler(RendererSurfaceControl_Load);
}

.NET Load event handle:
private void RendererSurfaceControl_Load(object sender, EventArgs e)
{
        PtakopyskInterface.Instance.Initialize(Handle.ToInt32());
        PtakopyskInterface.Instance.SetVerticalSyncEnabled(false);
}

.NET PtakopyskInterface.Initialize()
public bool Initialize(int windowHandle, bool editMode = true)
{
        try
        {
                bool status = _Initialize(windowHandle, editMode);
                Console.Write(_PopErrors());
                return status;
        }
        catch (Exception ex) { LogException(ex); return false; }
}

.NET native dll import
[DllImport(DLL, CallingConvention = CallingConvention.StdCall)]
[return: MarshalAs(UnmanagedType.U1)]
private static extern bool _Initialize(int windowHandle, bool editMode);

Native bridge initialization:
bool DLL_EXPORT _Initialize( int windowHandle, bool editMode )
{
    return PtakopyskInterface::use().initialize( windowHandle, editMode );
}

Native implementation initialization:
bool PtakopyskInterface::initialize( int windowHandle, bool editMode )
{
    if( !windowHandle )
    {
        m_errors << "Cannot initialize PtakopyskInterface: windowHandle cannot be null!\n";
        return false;
    }

    release();

    LOG_SETUP( "PtakopyskInterface.log" );
    GameManager::initialize();
    GameManager::setEditMode( editMode );
    m_renderWindow = xnew sf::RenderWindow( (sf::WindowHandle)windowHandle );
    m_gameManager = xnew GameManager();
    m_gameManager->RenderWindow = m_renderWindow;

    return true;
}

10
Graphics / Re: Window from handle and shaders not available.
« on: August 18, 2014, 03:48:51 pm »
yes :)
Quote
but when i try to load shader from editor code it fails on line that tells me that shaders are not available :<
means
if( !sf::Shader::isAvailable() )
    return 0;

and there is no error messages since .NET does not display errors from C std console.

11
Graphics / Window from handle and shaders not available.
« on: August 18, 2014, 03:35:34 pm »
Hi :) i have two versions of my framework - one for games and one for IDE scene editor, but whole code is the same with only one difference on creating sfml window. Version for games create window in default way, but version for IDE create window from handle (.NET control). Now: when i try to load shader from game code it works, but when i try to load shader from editor code it fails on line that tells me that shaders are not available :<
Here is some code that will tell you more about how i'm doing this:

Creating in-game window:
sf::RenderWindow* window = xnew sf::RenderWindow(
    sf::VideoMode( WINDOW_WIDTH, WINDOW_HEIGHT ),
    APP_NAME,
    sf::Style::Titlebar | sf::Style::Close
);

Creating editor window:
m_renderWindow = xnew sf::RenderWindow( (sf::WindowHandle)windowHandle );

Loading shaders:
sf::Shader* Assets::loadShader( const std::string& id, const std::string& vspath, const std::string& fspath, const std::string* uniforms, unsigned int uniformsCount )
{
        sf::Shader* t = getShader( id );
        if( !t )
        {
                if( !sf::Shader::isAvailable() )
                        return 0;
                t = xnew sf::Shader();
                if( m_fileSystemRoot.empty() )
                {
                        if( !t->loadFromFile( vspath, fspath ) )
                        {
                                DELETE_OBJECT( t );
                                return 0;
                        }
                }
                else
                {
                        std::stringstream ssv;
                        ssv << m_fileSystemRoot.c_str() << vspath;
                        std::stringstream ssf;
                        ssf << m_fileSystemRoot.c_str() << fspath;
                        if( !t->loadFromFile( ssv.str(), ssf.str() ) )
                        {
                                DELETE_OBJECT( t );
                                return 0;
                        }
                }
                m_shaders[ id ] = t;
                m_metaShaders[ id ] = vspath + "|" + fspath;
                m_uniformsShaders[ id ].clear();
                for( unsigned int i = 0; i < uniformsCount; i++ )
                        m_uniformsShaders[ id ].push_back( uniforms[ i ] );
                if( m_assetsChangedListener )
                        m_assetsChangedListener->onShaderChanged( id, t, true );
        }
        return t;
}

Does someone know why shaders are not available with window from handle, but they works with default window? I had the same problem when i used official SFML.NET assembly and tried to use shaders with window from handle.

Cheers! :)

12
SFML projects / Re: Ptakopysk - C++ game prototyping framework
« on: August 17, 2014, 11:44:50 am »
This time: step-by-step article about how to code your first custom component to work with game and IDE - keyboard input controler as example! :D
http://ptakopysk.psichix.com/custom-components-and-code-side-of-project/

13
SFML projects / Re: Ptakopysk - C++ game prototyping framework
« on: August 16, 2014, 05:56:18 am »
Is your IDE using SFML for the GUI Rendering?  It looks very nice!!   ;)
Only for Scene View (IDE must have to run project code inside IDE to make ability to properly manage game objects, components and properties).

14
SFML projects / Re: Ptakopysk - C++ game prototyping framework
« on: August 15, 2014, 11:20:55 am »
Yay! And next article about how to manage scene, game objects and components in Zasuvka Ptakopyska IDE! Yay!
http://ptakopysk.psichix.com/hello-game-objects-components-and-properties/
:)

15
SFML projects / Re: Ptakopysk - C++ game prototyping framework
« on: August 14, 2014, 08:48:23 pm »
Here is article about how to install and setup Ptakopysk toolset:
http://ptakopysk.psichix.com/ide-installation-setup/

Next article will be about first "Hello World" project and it will be published today! :D

Pages: [1] 2
anything