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

Pages: 1 [2] 3 4 ... 14
16
Graphics / Re: Drawing large triangles/sprites is slow | Possible bug?
« on: December 29, 2016, 08:32:22 pm »
Maybe you are just Fillrate-limited.

Number of pixels your graphics card has to draw:
With 10 large triangles: 10x800x800/2 = 3.2 Megapixel
With 500 small triangles: 500x100x100/2 = 2.5 Megapixel

So actually in terms of fillrate, 500 of your small triangles are even faster than 10 of your large ones. But with 500 triangles you get more overhead (draw calls) and more load on the rasterizer etc. In the end you get about the same performance.

I don't know if this is the reason for your observed behaviour but for me it seems plausible.

I couldn't have said it better. :D

17
General / Re: Sprite doesn't move along with handler exception
« on: December 29, 2016, 07:56:24 pm »
I have checked the dlls and lib and they are not mixed up as far as I can tell.What about the sprite not moving?Any suggestions?

Right now i´m kinda bussy.

But if you clean up and organize your code i could help you better.

But i recommend you something: First try to find what cause the access violation, this is worst than "my sprite is not moving".

By the way, if all your .dll and .libs are in the right places the best attempt you can do is rewrite all your code.

Remember that behind a good code there is a good algorithm and a good knowledge of the language that is being used.

19
General / Re: Sprite doesn't move along with handler exception
« on: December 28, 2016, 05:51:35 pm »
Quote
Access violation executing location 0x00000000.
the memory location corresponds to NULL ( 0x00000000 ) this means that you are dereferencing or writing on a NULL location.

I couldn't detect this error on your code "at glance" but you should do a more deep inspection.

Then if you believe that your code is not writing/reading a NULL pointer check if your .libs and .dll are the corrects for your compiler and debug/release are not mixed.

20
SFML projects / Re: Dispersio is now available on Steam!
« on: December 03, 2016, 04:48:29 am »
Great, i really like the retro style, and the music make it addictive and challenging.

21
General / Re: Converting sf::Event::MouseMoveEvent to sf::Vector2i
« on: November 14, 2016, 09:22:07 pm »
Quote
Quote
A bit off-topic, but why does Vector2 have no parenthesis overload?
I have no idea what you mean. An overload of the "parenthesis" operator () is defined when you need to "call" the object, so I guess this is not what you're talking about since it makes no sense to "call" vectors.

I think he means: user-defined conversion

22
Graphics / Re: Help with Clearing the Window
« on: November 10, 2016, 03:27:50 am »

This is because everithing that draws the windows modify what you see.

if you call
window.clear( sf::Color::White )

Any calls of those types
 window.clear( anyColorDifferentOfWhite )
and
 window.draw()
will change what the screen is drawing.

If you want to keep the color to white you'll need to ensure that only you have those types of calls
window.clear( sf::Color::White )
before
 window.display() ;

23
SFML projects / [Development] [Video Playback] SFVLC
« on: November 10, 2016, 01:28:21 am »
Since i need to play videos with SFML and i found this comment of Ceylo (the creator of sfeMovie)

Quote
Indeed there is the feature/OpenFromStream branch. However it is not finished. It is roughly what a user from SFML forum proposed, but I don't wish to work on sfeMovie anymore so it'll have to be finished by someone else. Basically what lacks at the moment is cleanly design integration and manual tests.

And beacuse i don't want use death projects i decide to write my own video player an take advantage of libVLC, that its core is LPGL-licensed and most of its plug-ins too.
The libVLC plug-in systems works like add-ons, you carry the dlls you want without have to recompile,
so we can have both commercial and non-commercial projects.

I need to polish the final details, that includes a loadFromStream feature, then i will release the source code on github, share the MSVC 2013 libraries, and hope someone help me to create a CMAKE build system.

The players deliver a high-performance, so you won't never be worried about it.

This is an simple example showing few features:



#include <iostream>
#include <cstdio>

#include <SFML/Graphics.hpp>
#include "sf_vlc_video.hpp"

int main()
{  
   
        sf::VideoMode fullScreenMode = sf::VideoMode::getDesktopMode() ;
        sf::VideoMode windowedMode = sf::VideoMode( 800 , 600 ) ;

        sf::RenderWindow window( windowedMode , "Video" ) ;
                         window.setFramerateLimit( 60 ) ;
   
    freopen( "null" , "w+" , stderr ) ; // Disable error/warning messaging. There are no way to fix|disable them.
       
        SFVLC::Video video( { windowedMode.width , windowedMode.height } ) ;

    video.loadFromURL( "http://video.webmfiles.org/big-buck-bunny_trailer.webm" ) ;
    // Or: video.loadFromFile( "myvideo.ogv" ) ;

        video.play() ;

        bool isFullscreen = false ;

        sf::Clock deltaClock ;

    while ( window.isOpen() )
    {  
        sf::Event event;
        while ( window.pollEvent( event ) )
        {
                        switch( event.type )
                        {
                                case sf::Event::Closed :
                                     video.stop() ;
                                         window.close() ;
                                         break ;

                                case sf::Event::KeyPressed :
                                {  
                                        switch( event.key.code )
                                        {
                                            case sf::Keyboard::Escape : // Exit.
                                                     video.stop() ;
                                                     window.close() ;
                                                         break ;
                                                case sf::Keyboard::Space : // Pause | Resume video with the space bar.
                                                {
                                                        if( video.getStatus() == SFVLC::Video::Status::playing )
                                                                video.pause() ;
                                                        else
                                                                video.play() ;
                                                        break ;
                                                }
                                                case sf::Keyboard::F : // Resize video to fullscreen or windowed mode.
                                                {  
                                                   if( !( isFullscreen = !isFullscreen ) )
                                                   {  
                                                       window.create( windowedMode , "Video" ) ;
                                                           window.setFramerateLimit( 60 ) ;
                                                           video.setSize( { windowedMode.width , windowedMode.height } ) ;
                                                   }
                                                   else
                                                   {  
                                                       window.create( fullScreenMode , "Video" sf::Style::Fullscreen ) ;
                                                           window.setFramerateLimit( 60 ) ;
                                                           video.setSize( { fullScreenMode.width , fullScreenMode.height } ) ;
                                                   }
                                                   break ;
                                                }
                                                case sf::Keyboard::BackSpace : // Restart the video.
                                                         video.restart() ;
                                                         break ;          
                                   }
                                }
            }
        }

                const float delta = deltaClock.restart().asSeconds() ;
               
                // Inherits from sf::Transformable.
                if( sf::Keyboard::isKeyPressed( sf::Keyboard::Right ) ) { video.move( delta * 10 , 0 ) ; }
                else if( sf::Keyboard::isKeyPressed( sf::Keyboard::Left ) ) { video.move( - delta * 10 , 0 ) ; }

                if( sf::Keyboard::isKeyPressed( sf::Keyboard::Up ) ) { video.move( 0 , - delta * 10 ) ; }
                else if( sf::Keyboard::isKeyPressed( sf::Keyboard::Down ) ) { video.move( 0 , delta * 10 ) ; }

        window.clear();
                window.draw( video ) ; // It's a sf::Drawable too.
        window.display();
    }

    return 0;
}

 


Hope in this (or the next) week i can release the code on GitHub with a good documentation and test-suite.

Features actually implemented:
-play for local file
-play for url
-get video information (only for local file)
-pause/play/stop/restart
-resize (native way)
-change video playing time.
-set audio channel.
-decrease/increase volume
-set aspect ratio.
-control update rate.

24
Quote
did you know that you only are deleting
 IState
and not the full
 StateMenu
. ?
The destructor is virtual, so that's fine.

Yes, i didn't note this.
But we still don't know if inside those virtual destructors the memory is well-released, we need to be sure of all before blame sf::Text.

A single bad deallocating can mess a lot of things. (Thats why new languages want to bring memory safety).

25
SFML projects / Re: experiment on Terrains
« on: November 03, 2016, 07:25:33 pm »
Good lights effects.  :D ;D

26
Main.cpp

void changeState(IState *(&state))
{
    if ( state->getStateMenu() )
    {
        delete state;
        state = new StateMenu();
    }
   
    else if ( state->getStateOptions() )
    {
        delete state;
        state = new StateOptions();
    }
       
    else if ( state->getStateManage() )
    {
        delete state;
        state = new StateManage();
    }
   
    else if ( state->getStateStart() )
    {
        delete state;
        state = new StateStart();
    }
}
 

StateMenu.h

class StateMenu : public IState
{
private:
    //...
public:
    StateMenu();
    ~StateMenu() {};
    //...
};

class IState
{
protected:
    //...
    sf::Texture t_background;
    sf::Sprite background;
public:
    IState();
    virtual ~IState() {};
    virtual void update() = 0;
    virtual void render() = 0;
        //...
};
 

I see that IState is an abstract class.

in the line after the while loop 
 delete state
did you know that you only are deleting
 IState
and not the full
 StateMenu
. ?

Are you sure you're correctly deallocating resources on those if/else if on the main.cpp?

27
And according to sending a code, I don't know what to post here, the problem is just too complex and I would have to send you few classes to show you what's going on.

Sure i want to help you.
But i will be limited because i run Windows 8 and you
Quote
I run Ubuntu 16.04, working on CodeLite 9.2.0 and compiling with Cross GCC (x86_64-linux-gnu)

If its a memory problem inside your classes sure i can help.
But if it something with the OS/Compiler/SFML (for Linux) i can't do much.

28
I don't know is this would be a bug or better a "not-to-do" issue.

We tend to call
window.create()
agian because we need to change some window's settings.

Why would one do that on Android? 
I believe that we need to have only one (and permanent) window until the apps get closed.

29
Whitout code or debug info we cannot point the problem itself.

You i would want to make a bet, the problem is not sf::Text, is another part of your code is messing the memory.

I remember one week ago having a problem with the lua_close() function, that frees the resources used by the lua state.

And there was a error triggered in the lua.dll, but i was overwriting the memory in other part of my program, probably messing up the memory allocated by Lua.

And that caused the crash.

Debuggers tend to say where te crash was found, but not what was the origin of the crash.

30
SFML projects / Re: Nero Game Engine
« on: November 01, 2016, 01:16:04 am »
Great progress, the GUI is very intuitive.

The engine is focus mostly on physics?

Pages: 1 [2] 3 4 ... 14