Jump to content

silageman

Members
  • Posts

    21
  • Joined

  • Last visited

Everything posted by silageman

  1. woops, never mind my fault i got it working now
  2. they simply won't work together can't even compile because MDd_DynamicDebug dosent match MTd_StaticDebug in main.obj and if i try to have them both the same to avoid the error then appkit complains the same and visa versa any way to avoid this or am i just stuck with this.
  3. it's because your embedding a window inside a window and it looses focus. One way to get around this would be to add the mouse click "left down" so the code would be in the while loop but before the event stuff. if (viewport->MouseDown(MOUSE_LEFT)) { viewport->Activate(); }
  4. spent a few hours on this and said i would post about it since it could be usefull to others here: #include "UltraEngine.h" #define SDL_MAIN_HANDLED #include <SDL.h> #include <SDL_image.h> using namespace UltraEngine; void clear(SDL_Renderer* renderer) { SDL_RenderClear(renderer); SDL_SetRenderDrawColor(renderer, 0, 0, 255, 255); } void draw(SDL_Renderer* renderer, SDL_Rect* rectangle) { SDL_Surface* surface = SDL_LoadBMP("test.bmp"); SDL_Texture* texture = SDL_CreateTextureFromSurface(renderer, surface); SDL_FreeSurface(surface); SDL_RenderCopy(renderer, texture, NULL, rectangle); SDL_RenderPresent(renderer); } int main(int argc, const char* argv[]) { //Get the available displays auto displays = GetDisplays(); //Create a window auto window = CreateWindow("SDL2 Example with Ultra App Kit", 0, 0, 1920, 1080, displays[0], WINDOW_TITLEBAR | WINDOW_RESIZABLE); auto ui = CreateInterface(window); iVec2 sz = ui->root->ClientSize(); auto viewport = CreateWindow("", 200, 8, sz.x - 200 - 8, sz.y - 16, window, WINDOW_CHILD); auto btnW = CreateButton("W", 0, 0, 200, 200, ui->root); auto btnS = CreateButton("S", 0, 200, 200, 200, ui->root); auto btnA = CreateButton("A", 0, 400, 200, 200, ui->root); auto btnD = CreateButton("D", 0,600, 200, 200, ui->root); SDL_Renderer* renderer; SDL_SetMainReady(); SDL_Init(SDL_INIT_EVERYTHING); auto getwindow = SDL_CreateWindowFrom(viewport->GetHandle()); renderer = SDL_CreateRenderer(getwindow, -1, SDL_RENDERER_ACCELERATED); SDL_Rect rectangle = { rectangle.x = 40, rectangle.y = 40, rectangle.w = 40, rectangle.h = 40 }; bool running = true; while (running) { clear(renderer); while (PeekEvent()) { const Event ev = WaitEvent(); switch (ev.id) { case EVENT_WINDOWCLOSE: if (ev.source == window) { return 0; } break; case EVENT_WIDGETACTION: if (ev.source == btnW) { rectangle.y -=10; } else if (ev.source == btnS) { rectangle.y += 10; } else if (ev.source == btnA) { rectangle.x -= 10; } else if (ev.source == btnD) { rectangle.x += 10; } break; } } draw(renderer, &rectangle); } SDL_DestroyWindow(getwindow); SDL_Quit(); return 0; }
  5. so deleting these works too but leaves empty space any widget that will automatically redraw on btn deletion?
  6. #include "UltraEngine.h" using namespace UltraEngine; int main(int argc, const char* argv[]) { auto displays = GetDisplays(); auto window = CreateWindow("Add Buttons", 0, 0, 640, 480, displays[0], WINDOW_TITLEBAR | WINDOW_RESIZABLE); auto ui = CreateInterface(window); auto sz = ui->root->ClientSize(); array<shared_ptr<Widget>, 10> btn; int inc = 0; int space = 0; btn[0] = CreateButton("add", 0, 0, 100, 100, ui->root); while (true) { const Event ev = WaitEvent(); switch (ev.id) { case EVENT_WIDGETACTION: if(ev.source == btn[inc]){ space=space+100; btn[inc+1] = CreateButton("+", 0,space, 100, 100, ui->root); Print(inc); inc= inc+1; break; } break; case EVENT_WINDOWCLOSE: return 0; break; } } }
  7. Can anyone give me an example? do I have to create a custom widget or can I do this with the included widgets for example add text line edit on button press while the app is running.
  8. it seems to work from http:// some url but not a local path even tho it says loading icon /contents/resources /some.svg auto icon = LoadIcon("des.svg"); ui->root->SetIcon(icon); even when I look in show package contents its where it's supposed to be any help or is this a known problem
  9. on kubuntu latest using the official install of steam the auto generated makefile wont build because of file structure changes. take a look at the screenshots below for fix. it's '/Release/AppKit.o' - this was the only way i could build for linux can you push out a fix for this as it will pee people off and is an easy fix. or at least mention somewhere how to build this with configname Thanks.
  10. #include "UltraEngine.h" using namespace UltraEngine; int main(int argc, const char* argv[]) { //Get the displays auto displays = GetDisplays(); //Create a window auto window = CreateWindow("Ultra Engine", 0, 0, 640, 480, displays[0], WINDOW_TITLEBAR | WINDOW_CENTER); //Create User Interface auto ui = CreateInterface(window); //Create buttons int x = (window->ClientSize().x - 120) / 2; int y = 350; int sep = 0; auto button = CreateButton("CONVERT", x, y, 300, 60, ui->root); y += sep; while (true) { const Event ev = WaitEvent(); switch (ev.id) { case EVENT_WIDGETACTION: if (ev.source->As<Widget>()->text == "CONVERT") { WString file = RequestFile("Open File", "", "All Files:*", 0, false); Print(file); return 0; //Print(Command("./ffmpeg -h")); } break; case EVENT_WINDOWCLOSE: return 0; break; } } return 0; } here just to make easier, latest Xcode and app kit from the App Store on big sur. it's hardly a permission thing?
  11. https://www.ultraengine.com/learn/CPP/RequestFile the documentation is not great here am trying to pass in a file any file so I can convert with FFmpeg just need an example of request file that will accept any file extension on Mac OS big sur. thanks
  12. #include "Libraries/box2d/include/box2d/box2d.h" sorry i found it
  13. for example how do i reference it in code can we get an example for this. Also whats 2dkit and is it nearly finished
  14. everything is default both leadwerk and steam are in default steam locations
  15. it can't find leadwerks.h file still steps to reproduce: download example project open sln with vs 2019 build solution error can't find leadwerks.h here is a screen grab of included directories for me with that project:
  16. the default paths in the app.h are wrong for the steam version also for leadwerks.h cant find file any help with this. using vs 2019 everything is the default and i have used the example project whats gone wrong with this.
  17. thanks josh i own leadwerks on steam too great stuff. i guess use opengl render for the sprite drawing for a basic 2d platformer?
  18. Hi, have a few general questions. I bought this on steam does that mean i own it forever or is it a rolling payment? also wanted to have a go at a basic 2d engine opengl based any recommendations.. i only just purchased this. thank for any and all help eoin
×
×
  • Create New...