Author Topic: nSDL 1.1.1 Anniversary Edition—The Ultimate TI-Nspire Graphics Library  (Read 140588 times)

0 Members and 1 Guest are viewing this topic.

Offline hoffa

  • Project Author
  • LV6 Super Member (Next: 500)
  • ******
  • Posts: 322
  • Rating: +131/-13
    • View Profile
Re: nSDL 1.0.2—A very fast & robust graphics library
« Reply #300 on: January 08, 2013, 01:47:26 pm »
Here's nSDL drawing the OpenBSD fish loaded from a GIF file:

How did you make it to have the right colours from a gif file ? I'm loading a gif image from /documents/Examples/map.gif and it doesn't have the right colours at all ... Have I to save it as a gif with 16-bits colours ? If so, how can you do it with Gimp ?
Dunno, I just saved the file as a GIF on Paint. Can you post the file here?
EDIT: Try if passing the surface through SDL_DisplayFormat() and see if it helps. BTW, for a speed boost you should always pass your files' surfaces through that function, it avoids SDL having to convert to the display format on the fly.
« Last Edit: January 08, 2013, 01:56:11 pm by hoffa »

Offline Matrefeytontias

  • Axe roxxor (kinda)
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1982
  • Rating: +310/-12
  • Axe roxxor
    • View Profile
    • RMV Pixel Engineers
Re: nSDL 1.0.2—A very fast & robust graphics library
« Reply #301 on: January 09, 2013, 01:04:57 am »
Ew, Out of Memory D: it's true that uncompressed, my gif file is 42 MB ... I'll just go with tilemapping.

Offline hoffa

  • Project Author
  • LV6 Super Member (Next: 500)
  • ******
  • Posts: 322
  • Rating: +131/-13
    • View Profile
Re: nSDL 1.0.2—A very fast & robust graphics library
« Reply #302 on: January 09, 2013, 06:32:06 am »
Did you fix the color issue or not? Could you attach the file that caused problems here?

Offline hoffa

  • Project Author
  • LV6 Super Member (Next: 500)
  • ******
  • Posts: 322
  • Rating: +131/-13
    • View Profile
Re: nSDL 1.0.2—A very fast & robust graphics library
« Reply #303 on: January 10, 2013, 07:23:02 am »
I'll be releasing a last version of nSDL before a very long pause. 6 months ago I said I wouldn't be able to update while in the army, but I could as I did have some free time. This time I really won't be able to work on nSDL at all, as I'm going backpacking in Australia for half a year, and I won't be taking my computer with me. So I want to release an Anniversary Edition of nSDL (as the 23rd it'll be 1 year since the creation of this thread) with some new features and such, and I also want to squash the last bugs so I can travel happily.

If you have ANY kind of ideas for improvements, suggestions, issues, whatever, please do say. Don't think too much about it, I'll do the filtering. :) Things that will be in the next release are among other things optimized pixel access functions and a solution to the relative path issue.

Offline Matrefeytontias

  • Axe roxxor (kinda)
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1982
  • Rating: +310/-12
  • Axe roxxor
    • View Profile
    • RMV Pixel Engineers
Re: nSDL 1.0.2—A very fast & robust graphics library
« Reply #304 on: January 10, 2013, 01:03:39 pm »
I attached the image that caused problems.

Also I think that some kind of shaders would be cool, like colour modifying or others.

Offline fb39ca4

  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1749
  • Rating: +60/-3
    • View Profile
Re: nSDL 1.0.2—A very fast & robust graphics library
« Reply #305 on: January 10, 2013, 01:07:15 pm »
Yeah, that would be a perfect candidate for tilemapping. As for shaders, wouldn't you just write those yourself in C?

Offline Matrefeytontias

  • Axe roxxor (kinda)
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1982
  • Rating: +310/-12
  • Axe roxxor
    • View Profile
    • RMV Pixel Engineers
Re: nSDL 1.0.2—A very fast & robust graphics library
« Reply #306 on: January 10, 2013, 01:11:11 pm »
Of course I could, as for every SDL command ._. but since it can be optimized to work together with SDL, why do not ask hoffa ?

Also,
Yeah, that would be a perfect candidate for tilemapping.
^ I don't understand that :/ (sorry, French inside)
« Last Edit: January 10, 2013, 01:12:18 pm by Matrefeytontias »

Offline fb39ca4

  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1749
  • Rating: +60/-3
    • View Profile
Re: nSDL 1.0.2—A very fast & robust graphics library
« Reply #307 on: January 10, 2013, 01:17:59 pm »
Of course I could, as for every SDL command ._. but since it can be optimized to work together with SDL, why do not ask hoffa ?

Also,
Yeah, that would be a perfect candidate for tilemapping.
^ I don't understand that :/ (sorry, French inside)
The picture would be good for tilemapping because there are a lot of repeated patterns in there.

I don't think shaders have ever been a part of pure SDL.

Offline Matrefeytontias

  • Axe roxxor (kinda)
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1982
  • Rating: +310/-12
  • Axe roxxor
    • View Profile
    • RMV Pixel Engineers
Re: nSDL 1.0.2—A very fast & robust graphics library
« Reply #308 on: January 10, 2013, 01:19:27 pm »
Of course I could, as for every SDL command ._. but since it can be optimized to work together with SDL, why do not ask hoffa ?

Also,
Yeah, that would be a perfect candidate for tilemapping.
^ I don't understand that :/ (sorry, French inside)
The picture would be good for tilemapping because there are a lot of repeated patterns in there.

Oh okay :)

And shaders aren't part of the original SDL, but why not make ones for nSDL ? We're not restricted to functionalities already existing in the original lib (see nSDL_LoadImage and others).

Offline hoffa

  • Project Author
  • LV6 Super Member (Next: 500)
  • ******
  • Posts: 322
  • Rating: +131/-13
    • View Profile
Re: nSDL 1.0.2—A very fast & robust graphics library
« Reply #309 on: January 10, 2013, 01:40:28 pm »
I have no issues, I get this while blitting the image: (don't mind the fish)



You do understand the surface IMG_Load returns is 8bpp as the GIF is 8bpp?

Offline Matrefeytontias

  • Axe roxxor (kinda)
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1982
  • Rating: +310/-12
  • Axe roxxor
    • View Profile
    • RMV Pixel Engineers
Re: nSDL 1.0.2—A very fast & robust graphics library
« Reply #310 on: January 10, 2013, 01:41:01 pm »
Yeah, but what's the code you're using ? You told me to use SDL_DisplayFormat, I did so.
« Last Edit: January 10, 2013, 01:41:25 pm by Matrefeytontias »

Offline hoffa

  • Project Author
  • LV6 Super Member (Next: 500)
  • ******
  • Posts: 322
  • Rating: +131/-13
    • View Profile
Re: nSDL 1.0.2—A very fast & robust graphics library
« Reply #311 on: January 10, 2013, 02:00:24 pm »
SDL_DisplayFormat converts the surface to the device's native format, i.e. on a CX it'll be converted to a 16-bit surface, on others it'll be 8 bpp. I think the issue is you're passing 16-bit color to the setpixel function that draws on a 8-bit surface or something. It's difficult to guess without the code.

As for the shaders, although it might be a good idea, it isn't really part of the low-level SDL philosophy, it's too high level without much use. I want to keep nSDL fast and efficient, as a razor sharp robust base for other things, or something.

EDIT: Maybe you should initialize SDL as 8 bpp? nSDL handles 8 bpp on CX, and as you're only dealing with 8 bpp stuff it would maybe be easier to concentrate only on one bit depth?
« Last Edit: January 10, 2013, 02:27:07 pm by hoffa »

Offline ruler501

  • Meep
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2475
  • Rating: +66/-9
  • Crazy Programmer
    • View Profile
Re: nSDL 1.0.2—A very fast & robust graphics library
« Reply #312 on: January 10, 2013, 06:11:01 pm »
Maybe base a version of SDL2
* ruler501 hides
In all seriousness though it might be nice to have some form of shaders, but I'm not sure if they would go well with SDL. It would probably be better to have a seperate library for them.
One thing I think could be nice for some people would be to have more example programs illustrating nSDL specific programs and problems that might arise.
I currently don't do much, but I am a developer for a game you should totally try out called AssaultCube Reloaded download here https://assaultcuber.codeplex.com/
-----BEGIN GEEK CODE BLOCK-----
Version: 3.1
GCM/CS/M/S d- s++: a---- C++ UL++ P+ L++ E---- W++ N o? K- w-- o? !M V?
PS+ PE+ Y+ PGP++ t 5? X R tv-- b+++ DI+ D+ G++ e- h! !r y

Offline hoffa

  • Project Author
  • LV6 Super Member (Next: 500)
  • ******
  • Posts: 322
  • Rating: +131/-13
    • View Profile
Re: nSDL 1.0.2—A very fast & robust graphics library
« Reply #313 on: January 10, 2013, 07:15:43 pm »
I actually looked at SDL2, and I've been waiting for a long time for a stable version to come out (even for one PC project I'm working on that uses SDL2). Even when does come out, SDL2 has very little to add to a machine such as the TI-Nspire, expect maybe for the included drawing (lines and whatnot) functions.

As far as example programs are concerned, that's a very good point, and there'll be included sample(s) in the next release.

Offline ruler501

  • Meep
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2475
  • Rating: +66/-9
  • Crazy Programmer
    • View Profile
Re: nSDL 1.0.2—A very fast & robust graphics library
« Reply #314 on: January 10, 2013, 08:05:53 pm »
I actually looked at SDL2, and I've been waiting for a long time for a stable version to come out (even for one PC project I'm working on that uses SDL2). Even when does come out, SDL2 has very little to add to a machine such as the TI-Nspire, expect maybe for the included drawing (lines and whatnot) functions.

As far as example programs are concerned, that's a very good point, and there'll be included sample(s) in the next release.
yeah I see how SDL2 is more for higher power devices. I don't think there's much added that you can't easily implement as a side part.
I currently don't do much, but I am a developer for a game you should totally try out called AssaultCube Reloaded download here https://assaultcuber.codeplex.com/
-----BEGIN GEEK CODE BLOCK-----
Version: 3.1
GCM/CS/M/S d- s++: a---- C++ UL++ P+ L++ E---- W++ N o? K- w-- o? !M V?
PS+ PE+ Y+ PGP++ t 5? X R tv-- b+++ DI+ D+ G++ e- h! !r y