Jump to content

codeape

Members
  • Posts

    183
  • Joined

  • Last visited

Posts posted by codeape

  1. I am pplaying with changing the resolution in my game. My idea was to start simple ... Hit L and the resolution is changed. So when So when I call window->SetLayout(0, 0, 1600, 1200) the resolution is not changed from the default 1024x768.Codes:

    #include "App.h"#include "game/BranchLoop.h"using namespace Leadwerks;App::App() : window(NULL), context(NULL), world(NULL), camera(NULL), loop(NULL){}App::~App() { if (NULL != loop) { delete loop; } if (NULL != world) { delete world; } if (NULL != window) { delete window; }}bool App::Start(){ //Initialize Steamworks (optional) /*if (!Steamworks::Initialize()) { System::Print("Error: Failed to initialize Steam."); return false; }*/ //Create a window window = Leadwerks::Window::Create("branch"); //Create a context context = Context::Create(window); //Create a world world = World::Create(); //Create a camera camera = Camera::Create(); camera->Move(0,2,-5); loop = new Branch::BranchLoop(context, window, camera); //Hide the mouse cursor window->HideMouse(); std::string mapname = System::GetProperty("map","Maps/start.map"); Map::Load(mapname); //Move the mouse to the center of the screen window->SetMousePosition(context->GetWidth()/2,context->GetHeight()/2); return true;}bool App::Loop(){ //Close the window to end the program if (window->Closed()) return false; //Press escape to end freelook mode if (window->KeyHit(Key::Escape)) { window->ShowMouse(); return false; } if (window->KeyHit(Key::L)) { System::Print("Change layout"); window->SetLayout(0, 0, 1600, 1200); } loop->preRenderUpdate(); Leadwerks::Time::Update(); world->Update(); world->Render(); loop->postRenderUpdate(); context->Sync(false); return true;}

    And yeha, I get the output "Change layout" but nothing happens.

  2. No - which is not much of a supprise as it seems to be a windows issue with 13.12 ( the "linux" google picks up on is from the page tree in the side bar )

     

    blink.png Sorry ... I went through some of the links, but missed to check for OS, you are right. That was windows. Well, I hope this gets solved.

  3. Another video on the subject this time with voice added to hopefully get the point across that this bug is not Nvidia specific.

     

     

    I do not know if this helps, but it looks like AMD is having problems with flickering all over the place:

    https://www.google.se/webhp?sourceid=chrome-instant&ion=1&espv=2&ie=UTF-8#q=radeon+hd+6850+linux+catalyst+driver+flickering+site:forums.amd.com

     

    I found some Linux Catalyst 13 dirvers in the mix and various cards including 6850 so do you see this problem in other OpenGL apps?

  4. Could you clarify please what that means? are these bugs not happening to you or are you just ignoring them?

     

    Well I use the Editor for some things like creating prefabs and creating test maps for my hobby game creations. Most things I do are PCG though so I probably do not use all of the functionality of the editor (like terrain).

     

    Edit; I see you've listed Windows 7 as among'st your OS'es - I assume your using the editor from there?

     

    No, I do 99% of my stuff in vanilla Ubuntu 14 and only compile on Windows to test that my stuff works on both platforms. I have developed for Linux since 1998 so I am more comfortable with do things on Linux.

     

    EDIT: Some clarifications on my editor usage.

    • Upvote 1
  5. So I really like Leadwerks. However, I see that a lot of problems tracked back to GTK and capabilities of different UI toolkits.

     

    So why not doing things the Blender way? Create your own OpenGL UI toolkit with a event system and/or a message system and create an editor that uses the same UI toolkit for all platforms.

     

    OK, I am not stupid ... this is not a small thing and maybe not the most fun thing to do. However it could be a long time goal and a nice evolution of Leadwerks.

     

    There are many pros:

    + Same UI code for all platforms.

    + The UI could be used by both the editor and in the games we make with Leadwerks.

    + You will be using your own UI that you have 100% control over.

    + UI is a feature people want

    + No more OS dependent UI bugs.

     

    The con:

    - More things to do.

    - It will take a loooooooooooooong time to accomplish.

  6. Ok this is pretty cool. I sugested that Limit Theory (a awesomely looking and upcoming space game) to implement SDF:

    http://forums.ltheory.com/viewtopic.php?f=6&t=2137&p=28611&hilit=sdf#p28611

     

    After a couple of months he did it! With better font render quality and performance than the old solution (through SFML):

    http://forums.ltheory.com/viewtopic.php?f=12&t=3875&p=75231&hilit=sdf#p75231

     

    Here is the result (30:01 in to the dev video ... the link point to that part of the video ):

     

    I think you should do what he did. Implement SDF your self and do not use third party stuff.

  7. I do this:

     

    > cd ~/.steam/steam/SteamApps/common/Leadwerks
    > find . -name *.bak*
    ./MyGame/Shaders/PostEffects/Bloom/hblur.shader.bak1
    ./MyGame/Shaders/PostEffects/Bloom/vblur.shader.bak1
    ./MyGame/Shaders/PostEffects/Bloom/bloom.shader.bak1
    ./Templates/Common/Shaders/PostEffects/Bloom/hblur.shader.bak1
    ./Templates/Common/Shaders/PostEffects/Bloom/vblur.shader.bak1
    ./Templates/Common/Shaders/PostEffects/Bloom/bloom.shader.bak1
    

     

    Should I be concerned over the bak files? Ok, they should be backups but to me they look newer than my non bak versions.

  8. I looked in the update.log after the last update:

     

    Copying "/home/codeape/.steam/steam/SteamApps/common/Leadwerks/Templates/Common/Shaders\PostEffects\Bloom\hblur.shader.bak1" to "/home/codeape/src/git/leadwerks/branch/branch/Shaders\PostEffects\Bloom\hblur.shader.bak1"...
    Copying "/home/codeape/.steam/steam/SteamApps/common/Leadwerks/Templates/Common/Shaders\PostEffects\Bloom\vblur.shader.bak1" to "/home/codeape/src/git/leadwerks/branch/branch/Shaders\PostEffects\Bloom\vblur.shader.bak1"...
    Copying "/home/codeape/.steam/steam/SteamApps/common/Leadwerks/Templates/Common/Shaders\PostEffects\Bloom\bloom.shader.bak1" to "/home/codeape/src/git/leadwerks/branch/branch/Shaders\PostEffects\Bloom\bloom.shader.bak1"...
    

     

    Why is Leadwerks copying bak1 files from .steam/steam/SteamApps/common/Leadwerks/Templates/ to my project?

     

    Here is a diff of branch/Shaders\PostEffects\Bloom\bloom.shader and branch/Shaders\PostEffects\Bloom\bloom.shader.bak1

     

    diff -w bloom.shader bloom.shader.bak1
    78c78
    < uniform float overdrive=1.0;//The higher this value, the brighter the bloom effect will be
    ---
    > uniform float overdrive=2.0;//The higher this value, the brighter the bloom effect will be
    

     

    Is this a bug?

  9. Ok, all I had to do to get the bug to go away was to start steam like this:

     

    export LANG=en_US.UTF-8
    export LC_ALL=en_US.UTF-8
    steam
    

     

    Found it in another thread posted this week biggrin.png ... 2 months without a working Texture Editor has been a bit tough though.

     

    My original list of LC and LANG looks like this:

     

    LANG="en_US.UTF-8"
    LANGUAGE="en_US"
    LC_ADDRESS="sv_SE.UTF-8"
    LC_IDENTIFICATION="sv_SE.UTF-8"
    LC_MEASUREMENT="sv_SE.UTF-8"
    LC_MONETARY="sv_SE.UTF-8"
    LC_NAME="sv_SE.UTF-8"
    LC_NUMERIC="sv_SE.UTF-8"																															   
    LC_PAPER="sv_SE.UTF-8"																																 
    LC_TELEPHONE="sv_SE.UTF-8"
    LC_TIME="sv_SE.UTF-8"
    

     

    So I had the LANG correct but I had not set LC_ALL=en_US.UTF-8.

  10. The truth is, there's no such thing as instances. When you call Shader::Load() the second time, it just returns the original and increments the ref count. So the shaders ref count at that point would be 2.

     

    Very nice indeed. Thank you for all the help guys biggrin.png

  11. Everything in Leadwerks is derived from the Object class...The graphics and physics modules, math classes like Vec3's, everything. So getting your summary ref count down to zero is just about impossible.

     

    There is no "total" ref count kept of all objects.

     

    Thnx, got it.

     

    Another question about reference counting. If I do like this:

     

    class A {
    ...
    Shader aShader1 = Shader::Load("shaders/my.shader")
    ...
    }
    ...
    class B {
    ...
    Shader sameShade = Shader::Load("shaders/my.shader")
    ...
    }
    

     

    Will this result in a ref count of 2 for the same instace of a Shader instance using "shaders/my.shader" or will this result in 2 instances of Shader with a refcount of 1 each. I can not find any info about that in the doc.

     

    Thank you again.

  12. It gets automatically freed when there are 0 refs, but you can free it manually before this.

    Eg. I imagine that the engine will free entities when unloading the map that spawned them regardless of ref count.

     

    Yes of course ... but I am a tidy person biggrin.png

  13. Why do you want to count references - if your looking for leaks surely instances are what's interesting?

     

    I mean you could potentially have lots of pointers pointing to a free()'ed instance and that wouldn't indicate a leak.

     

    If I do not do shader->Release() but have done shader->AddRef(), wouldn't I get a memory leak? Isn't the point that when shader->Release() make the ref count go to 0 the Leadwerks::Object sub-class freed?

     

    Have I misunderstood Leadwerks ref count completely?

  14. I understand the concept of reference counting and I have read this:

    http://www.leadwerks.com/werkspace/page/documentation/_/user-guide/getting-started/reference-counting-r613

     

    As I understand it I can get the total amount of references to a Leadwerks::Object sub-class instance by doing this (C++):

    shader = material->GetShader();
    int count = shader->GetRefCount()
    

     

    My question is if it is possible to get the total amount of references for all instances of Leadwerks::Object and sub-classes. I want to print it right before I exit my game so that I know that all my resources has been released (avoid memory leaks).

     

    Thanks for any help in advance.

×
×
  • Create New...