actsl / kiss_sdl Goto Github PK
View Code? Open in Web Editor NEWSimple generic GUI widget toolkit for SDL2
License: Other
Simple generic GUI widget toolkit for SDL2
License: Other
It seems kiss_init
creates an entirely new SDL_Window
along with it's SDL_Renderer
and all that.
But how would I use this for e.g a game UI where they it should be on the same window?
Hello!
Sorry for creating another issue here, I hope I'm not becoming bothersome! After upgrading my test project to the latest version of KISS_SDL, 0.10.6, I'm seeing undefined linker errors. Specifically, the following.
Undefined symbols for architecture x86_64:
"kiss_clean(kiss_array*)", referenced from:
_main in main.cpp.o
"kiss_array_new(kiss_array*)", referenced from:
_main in main.cpp.o
"kiss_label_new(kiss_label*, kiss_window*, char*, int, int)", referenced from:
_main in main.cpp.o
"kiss_button_new(kiss_button*, kiss_window*, char*, int, int)", referenced from:
_main in main.cpp.o
"kiss_label_draw(kiss_label*, SDL_Renderer*)", referenced from:
_main in main.cpp.o
"kiss_window_new(kiss_window*, kiss_window*, int, int, int, int, int)", referenced from:
_main in main.cpp.o
"kiss_button_draw(kiss_button*, SDL_Renderer*)", referenced from:
_main in main.cpp.o
"kiss_window_draw(kiss_window*, SDL_Renderer*)", referenced from:
_main in main.cpp.o
"kiss_button_event(kiss_button*, SDL_Event*, int*)", referenced from:
button_event(kiss_button*, SDL_Event*, int*, int*) in main.cpp.o
"kiss_window_event(kiss_window*, SDL_Event*, int*)", referenced from:
_main in main.cpp.o
"kiss_init(char*, kiss_array*, int, int)", referenced from:
_main in main.cpp.o
ld: symbol(s) not found for architecture x86_64
In my main.cpp, changing
#include "kiss_sdl.h
to
extern "C" {
#include "kiss_sdl.h"
}
fixes the issues, and the project then builds, links, and runs as expected. Adding the following back to the header fixed this for me.
#ifdef __cplusplus
extern "C" {
#endif
...
#ifdef __cplusplus
};
#endif
Here's a pull request to add the above definition back to kiss_sdl.h, but please ignore it if there are better ways!
Sorry for creating so many issues! Please let me know if you'd appreciate some radio silence, or if I need to learn a bit more about how to use my compiler, or something. Thank you for the support!
I don't know by now what to do with it, so i created this issue myself. It was posted in Satck Overflow https://stackoverflow.com/questions/69351191/sdl2-and-kiss-sdl-trouble-linking-on-macos
The SDL include files are not used to be under SDL2 for MSVC and Mac, thus so far the code has worked for these using MSVC or Mac. But now for the first time someone had a problem who uses Mac and has SDL include files under SDL2. I'm willing to fix it if it is an issue, but i don't know by now what to do, if there were some compiler macros for that case, then i could use them. Otherwise i don't know by now when and for what compiler are the SDL libraries installed under SDL2 in Mac, and when they are not.
In Mac, the include files and libraries for linking are determined by framework. The framework for SDL2 should thus provide the include files and libraries, and there is no need for specifying SDL2 directory. In what case is it different and how to find it out is by now not certain. I don't have Mac, so i cannot find out whether it was just a result of wrongly installing the framework, some who have Mac may help. So i will leave this issue open until this becomes clear, and it can be decided whether there is a need to make any change or not.
By now the solution for these who may encounter that problem, is to edit kiss_makefile and add -U__APPLE__ to CFLAGS , this should prevent defining the macro __APPLE__
, if that solves it. The last option is to manually edit kiss_sdl.h file, but it may not go so far. Sorry for inconvenience in that case. I have thought to add a Python build script to the project, that may solve such unexpected issues, but because it adds an additional dependency on Python, i have so far avoided that.
Hello!
Sorry to raise another issue here, but I'm having trouble using KISS_SDL with C++. Specifically, when linking the example code from page 4 of the manual, several duplicate symbol linker errors pop up. I asked about this on StackOverflow, and the answer I got seemed to suggest that the header does actually contain duplicate variable definitions. As a preliminary test, I commented out a few of the duplicate variables from kiss_sdl.h, and several of the linker errors were solved. I'm going to do some digging to see if I can do something about this without modifying the library, but I wanted to bring your attention to it, in case the header or manual needs to be modified.
For reference, the StackOverflow question is here, please see it for specifics.
Thank you!
Michael
Hello!
I'm trying to build the first example, but it's throwing a segmentation fault (Segmentation fault: 11
) when I run it. Everything does compile (albeit with lots of depreciation warnings) and link fine; I haven't really looked into the code to see if I can figure out why it's not working yet, I wanted to post here in case I'm already doing something wrong. I don't have a lot of experience with linking C to C++ code, so that could be the root of my problem. Also, the Makefile was not able to find my installation of SDL2, so I made a small CMakeLists for the project. I think it's unlikely that this would cause an issue, but it certainly could, as I'm pretty new to using CMake.
Bellow is the OS-generated [Mac OSX 10.11.5 Beta (15F31a)] crash log, and my entire test-project. Please let me know if there's any more information I can provide to help fix this.
Problem Report.txt
Test_KISS.zip
Thank you!
Michael
Just starting into the code so I understand it. I like it! I need to create a number of custom widgets for process control displays and this looks like a good basis to start with.
Anyway, on Line 515 of kiss_widgets.c there appears to be a typo in the function name:
int kiss_p[r]ogressbar_draw(...
/phil
Hello,
I am in a need of a "widget" (editing the window widget would suffice), that would be able to let it's content be bigger than what fits on the screen, and upon swipe (it's meant for android) would scroll to reveal the content.
The problem is, the content will be multiple widgets, which can be clicked, and I need smooth scrolling while still being able to properly execute events on the widget I click, and of course only on that one.
For drawing, I'm using https://github.com/memononen/nanovg/ , so I suppose I'll have to figure that out separately.
Is there a recommended way to do this?
Thanks in advance :)
I would make one, but there is no tex or doc file in the repo.
Tried to run example 2 in Visual Studio 2015 Community.
Found if you select anything but the first entry (eg select Baltimore) of the combo box the app crashes with exception thrown by combobox_event function. Appears the bsearch is returning a pointer to unreadable (maybe unallocated memory), haven't managed to diagnose this further.
PS Also noticed that Linker complains of no entry point, easily fixed by setting Linker > System > Subsystem to WINDOWS, not sure if that is intended?
Hi,
Good and simple little GUI kit!
I'm guessing it's not compatible with mobile?
Anyone got it working?
I got kiss_sdl built and example 1 working on linux and also built on NDK but when running it I get:
adb logcat com.example.hellojni:V hellojni:V SDL:V SDL2:V org.libsdl.app.SDLActivity:V com.example.hellojni/.HelloJni:V *:S
V/SDL ( 4092): Device: phone
V/SDL ( 4092): Model: phone
V/SDL ( 4092): onCreate(): null
V/SDL ( 4092): onResume()
V/SDL ( 4092): surfaceCreated()
V/SDL ( 4092): surfaceChanged()
V/SDL ( 4092): pixel format RGB_565
V/SDL ( 4092): Window size: 545x295
I/SDL ( 4092): SDL_Android_Init()
I/SDL ( 4092): SDL_Android_Init() finished!
V/SDL ( 4092): onWindowFocusChanged(): true
V/SDL ( 4092): onWindowFocusChanged(): false
V/SDL ( 4092): onPause()
V/SDL ( 4092): nativePause()
V/SDL ( 4092): surfaceDestroyed()
V/SDL ( 4092): surfaceCreated()
V/SDL ( 4092): onDestroy()
I'm a noob with Android.. so maybe I'm missing how to debug properly.
All the images are in the asset folder and accessible.
Any tips?
Cheers
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.