Jump to content

Aaron Symons

Members
  • Posts

    90
  • Joined

  • Last visited

Posts posted by Aaron Symons

  1. Hi guys,

     

    I was wondering if anyone's ever used a custom icon for their application's window. If so, what steps did you take?

     

    I imagine I might have to fiddle with the main.cpp file and possibly derive a new window class from Leadwerks::Window to get things working. One thing that will make this tricky: I'm targeting Windows OS, but eventually supporting OSX and Linux. smile.png

     

    Many thanks

  2. Hi guys,

     

    I understand this is a very old thread, but I think main.cpp may have changed since, and in the interest of keeping things updated...

     

    I've followed the answers to this question, but main.cpp uses argv and argc to do some setup prior to running the game. So, how would I go about setting up/adjusting the main.cpp?

     

    After making the changes suggested by @Roland, there are errors in main.cpp on lines:

    • #44
    • #63
    • #66

    ...where you can see the usage of argv and argc.

     

    I've attempted adding extra #ifdef and #ifndef checks for _DEBUG mode on these lines, and changing the code accordingly, but with no success.

     

    Any help and guidance would be greatly appreciated! smile.png

     

    Many thanks

  3. [i know this post could have been much better in explanation, but I'm tired and need sleep tongue.png ]

     

    Okay guys, another update on implementing an animated image file (now A-PNG) in Leadwerks.

     

    It's pretty simple: implement the TinyImageLoader ohmy.png!

     

    Use that library to read the APNG into a TIL::Image - by default it will give you image frame count - then, just use a Leadwerks::Texture to draw to the context, setting the texture's pixels to the appropriate TIL::Image frame's pixels based on a simple interval timer - using TIL to get the pixel data (and manually converting it to a char* before passing to the Leadwerks::Texture).

     

    There are a couple of good examples included with TinyImageLoader SDK. I just referenced the first example, and thought how I could create an actual Leadwerks::Texture from the information supplied to me by TinyImageLoader. happy.png

     

    I now have an Animated-PNG image that renders to the screen and auto-updates the frame based on a set interval. I was going to have the APNG class implement Leadwerks::Texture, but I don't feel like implementing the extra 30+ virtual methods right now! *sad face*

     

    That's all for now, as I feel it could be simple enough for others to implement - if not a good test of some basic C++ to C/C++1 implementation abilities. However, if anyone would like me to post a code example I will! smile.png

     

    Many thanks!

     

    1 The original code was written in C and then rewritten in C++ for TinymageLoader, though some C-style syntax does still appear.

    • Upvote 2
  4. I thought I'd update this thread, seeing as I said I would!

     

    During my research I came across issues with GIF licensing, and why the GNU - and others - pretty much refuse to even deal with GIF now.

     

    However, I came across Animated-PNG which is an extension to the PNG format developed by Mozilla! I think APNG is a viable substitute if we want to integrate animated images in Leadwerks.

     

    I have the APNG add-on for GIMP, and now I'm researching how to read the file's frames in C++ and draw them to the screen using OpenGL. I haven't come across much information yet, but I think it's worth the effort.

     

    smile.png

    • Upvote 1
  5. In Leadwerks.h, I changed

     

    #include <OpenAL/al.h>

    #include <OpenAL/alc.h>

     

    to

     

    #include "al.h"

    #include "alc.h"

     

    and I have no more OpenAL related errors. However, I do have issues in Steamworks.h now.

     

    Line #85 to #93: STEAM_CALLBACK() is missing an explicit type, and its parameters are all undefined.

     

    Line #104: HHTMLBrowser is undefined.

     

    Line #214: return type of "uint32" instead of "uint32_t".

     

    There are many others as well. I'm guessing that I'm still missing other dependencies somewhere. dry.png

     

     

    EDIT:

    Line #13 in Mutex.h - pthread_mutex_t is undefined. Definitely still missing lots of dependencies! ohmy.png

  6. Hi guys!

     

    I've created a new Project in the Solution which will be for one of my custom frameworks/libraries. My framework references the Leadwerks library and classes.

     

    I'm currently having difficulties setting up the project to compile, as I get this error:

     

    Error 1 error C1083: Cannot open include file: 'OpenAL/al.h': No such file or directory

     

    I've added the dependencies and path macros for this new Project, trying to mimic the setup of the Project in the generated Solution from Leadwerks. I'm not sure what I'm missing!

     

    Any advice and guidance would be greatly appreciated! smile.png

     

    Many thanks

  7. This should not occur. You should post your code. Or compare my example to what you are doing to see the difference.

     

    Your code basically follows the same flow I'm using, except I don't set the context color before clearing the context.

     

    Everything renders as needed now, but if you think I definitely should be setting the context color before clearing the context, we can explore and discuss further. :)

     

    Thanks!

  8. Hi guys,

     

    Thanks for the response. Clearing the context works, but only works without setting the color (before or after clearing), as I receive a black screen. However, as my background is currently black, I feel I could possibly draw a black background instead of setting the context color. This might be the way to go.

     

    I'll keep you guys updated with what I find.

     

    Thanks again! :)

  9. Hi all!

     

    I have a custom Cursor class written in C++. The image (a *.tex file) is being drawn multiple times across the window as I move the mouse.

     

    How can I draw it only where the mouse is, and avoid it being drawn all over the place? smile.png

     

    I have this for drawing:

    context->SetBlendMode(Leadwerks::Blend::Alpha);
    context->DrawImage(cursorImage, (mousePosition.x - cursorOffset.x), (mousePosition.y - cursorOffset.y));
    context->SetBlendMode(Leadwerks::Blend::Solid);
    

     

    I've attempted clearing the context - which resolves this issue - but other drawn images do not display, as the cursor is the last thing to be drawn.

     

    Many thanks

  10. Hi all,

     

    I've just started getting back into C++ and Leadwerks and I'm having an issue with a simple task: displaying a model created in code at runtime. The model doesn't display, and all I see is a black screen.

     

    If anyone could offer any advice on how to look for the problem I would be very grateful!

     

    App.h

    #pragma once

     

    #include "Leadwerks.h"

     

    #undef GetFileType

     

    using namespace Leadwerks;

     

    class App

    {

    public:

    Leadwerks::Window* window;

    Context* context;

    World* world;

    Camera* camera;

    Light* light;

     

    Model* box;

     

    App();

    virtual ~App();

     

    bool Start();

    bool Loop();

    };

     

    App.cpp

    #include "App.h"

     

    using namespace Leadwerks;

     

    App::App() : window(NULL), context(NULL), world(NULL), camera(NULL) {}

     

    App::~App() { delete world; delete window; }

     

    bool App::Start()

    {

    // Create main window

    window = Window::Create("Hello there!", 100, 100, 1024, 768, Window::Titlebar);

     

    // Create context

    context = Context::Create(window);

     

    // Create the world

    world = World::Create();

     

    // Create camera

    camera = Camera::Create();

    camera->Move(Vec3(0, 2, -5));

     

    // Create a light

    light = DirectionalLight::Create();

    light->SetRotation(45, 45, 0);

     

    // Create a box

    box = Model::Box();

    box->SetPosition(-4, 0, 0);

     

     

     

    return true;

    }

     

    bool App::Loop()

    {

    // Close window on 'exit button' or ESC key is pressed

    if (window->Closed() || window->KeyHit(Key::Escape))

    {

    return false;

    }

     

    Time::Update();

    world->Update();

    world->Render();

     

    return true;

    }

     

    Many thanks!

  11. Hi guys,

     

    I'm not sure if this is a bug with Leadwerks or Steam, or both. However, I've just updated Leadwerks and tired to run it, receiving the following warning: "Can't initialize program. Please start Steam".

     

    The Steam client is running, and I've even tried running it as administrator. I've also tried the previous in combination with launching Leadwerks from within Steam and from the Leadwerks application shortcut on my desktop.

     

    The same happens when trying to launch LE Game Launcher as well.

     

    Does anyone have any further ideas to try, or as to what this could be?

     

    Thanks in advance! smile.png

     

    P.S. Happy holidays! biggrin.png

  12. Each time you load the prefab, are the textures and materials loaded as well, or are they only loaded once during the load of the first prefab? I would guess they're only loaded once and then just referred to for each prefab, but if they're not, that would impair performance somewhat.

  13. Sorry, I meant to say that the only Lua headers I have are included in an old install of LE before it went on Steam. My Steam version doesn't have the Include and Library paths, but the install does exist in SteamApps, as you mention.

     

    Should be about here :

    C:\Program Files (x86)\Steam\SteamApps\common\Leadwerks Game Engine\Library\Windows\x86\lua51.lib

     

    But could be that is only included with the std ed?

     

    That's what I'm thinking. :)

  14. I know, but I don't have those folders there.

     

    I have the Lua header files here: "C:\Leadwerks\Engine\Source\Libraries\lua-5.1.4" (from a previous install - demo from 2.x I think), but there's no lua.lib file anywhere on my computer. I ran a full search for that, and also searched for all *.lib files in my Leadwerks directories with no luck.

  15. I've now created a fresh and simplified VS project: just the "luaopen_power()" exists which prints a message when called.

     

    We're now back to: "The specified procedure could not be found.", and I've attempted loading the DLL with both require() and package.loadlib().

     

    I may try again tomorrow. lol unsure.png

     

    EDIT: I may even just buy the Standard Edition of LE, especially seeing as it's on sale now. :)

×
×
  • Create New...