Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add example widget using an nk_image to the sdl_renderer demo #613

Closed

Conversation

zoogies
Copy link

@zoogies zoogies commented Feb 21, 2024

This PR is intended to help illustrate the creation of nk_image from SDL_Surface and SDL_Texture.

A nk_button_image_label has been added to the sdl_renderer demo which looks like this:

Screenshot_20240221_143348

The icon is loaded from small bmp image that has been added to the example/icon directory, since SDL can only load bmp images without linking against something like SDL_Image.

Some things potentially worth considering:

  • should the relative pathing to the bmp in example/icon be handled differently?
  • would it be better to eliminate the added image by instead using an existing png and linking against SDL_Image?

When I first started using Nuklear, an example like this would have been of great assistance to me.

Cheers! 😄

@RobLoach
Copy link
Contributor

RobLoach commented Mar 7, 2024

Thanks, I'm sure this will be helpful for others looking to bring SDL images in. While we will likely want to keep all the examples the same, I'm sure people would appreciate if you added some notes about SDL images to the wiki:
https://github.com/Immediate-Mode-UI/Nuklear/wiki/SDL-%28OpenGL-3%29

@RobLoach
Copy link
Contributor

I've pushed up your code over at https://github.com/Immediate-Mode-UI/Nuklear/wiki/SDL . Thanks for the demonstration! Feel free to edit it if you think it could do with some tweaks.

@RobLoach RobLoach closed this Mar 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants