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

0 Members and 2 Guests are viewing this topic.

Offline apcalc

  • The Game
  • CoT Emeritus
  • LV10 31337 u53r (Next: 2000)
  • *
  • Posts: 1393
  • Rating: +120/-2
  • VGhlIEdhbWUh (Base 64 :))
    • View Profile
Re: nSDL (0.1.2 beta)
« Reply #120 on: March 20, 2012, 10:06:17 pm »
Great progress!  :D


Offline Lionel Debroux

  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2135
  • Rating: +290/-45
    • View Profile
    • TI-Chess Team
Re: nSDL (0.1.2 beta)
« Reply #121 on: March 21, 2012, 02:35:38 am »
Good ;)
Member of the TI-Chess Team.
Co-maintainer of GCC4TI (GCC4TI online documentation), TILP and TIEmu.
Co-admin of TI-Planet.

Offline Jim Bauwens

  • Lua! Nspire! Linux!
  • Editor
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1881
  • Rating: +206/-7
  • Linux!
    • View Profile
    • nothing...
Re: nSDL (0.1.2 beta)
« Reply #122 on: March 21, 2012, 04:55:54 am »
Indeed, very nice :)

Offline ExtendeD

  • CoT Emeritus
  • LV8 Addict (Next: 1000)
  • *
  • Posts: 825
  • Rating: +167/-2
    • View Profile
Re: nSDL (0.1.2 beta)
« Reply #123 on: March 21, 2012, 08:47:04 am »
Great job hoffa!
Does the current version would allow to port easily SDL-based programs of other platforms?
And do you think some of these libs would work? http://www.libsdl.org/libraries.php?category=12&os=8
Ndless.me with the finest TI-Nspire programs

Offline hoffa

  • Project Author
  • LV6 Super Member (Next: 500)
  • ******
  • Posts: 322
  • Rating: +131/-13
    • View Profile
Re: nSDL (0.1.2 beta)
« Reply #124 on: March 21, 2012, 10:08:21 am »
I've tried porting some very small SDL programs and it works well. Haven't tried porting anything bigger yet though.

As far as the libs are concerned, most of the libs there seem portable. SDL_image for instance certainly is, and it's on my todo list.

Offline hoffa

  • Project Author
  • LV6 Super Member (Next: 500)
  • ******
  • Posts: 322
  • Rating: +131/-13
    • View Profile
Re: nSDL (0.1.3 beta)
« Reply #125 on: March 24, 2012, 12:48:37 pm »
Finished writing the how-to guide. Enjoy. :)

Also rolled out 0.1.3, only change being the -O3 switch in the Makefile which gave a huge performance boost.

Offline Nick

  • LV9 Veteran (Next: 1337)
  • *********
  • Posts: 1166
  • Rating: +161/-3
  • You just got omnom'd
    • View Profile
    • Nick Steen
Re: nSDL (0.1.3 beta)
« Reply #126 on: March 24, 2012, 12:55:55 pm »
what do you mean with performance? faster? or less usage of the processor for the same executions?

how much better does it perform now?

Offline hoffa

  • Project Author
  • LV6 Super Member (Next: 500)
  • ******
  • Posts: 322
  • Rating: +131/-13
    • View Profile
Re: nSDL (0.1.3 beta)
« Reply #127 on: March 24, 2012, 01:07:01 pm »
Faster as in it draws faster. As I mentioned a few posts earlier, it improved drawing speeds by about 110% (i.e. over twice as fast).

EDIT: here
« Last Edit: March 24, 2012, 01:08:03 pm by hoffa »

Offline ExtendeD

  • CoT Emeritus
  • LV8 Addict (Next: 1000)
  • *
  • Posts: 825
  • Rating: +167/-2
    • View Profile
Re: nSDL (0.1.3 beta)
« Reply #128 on: March 24, 2012, 01:35:04 pm »
What doesn't make any sense is the size improvement induced by -O3 compared to -Os.
Ndless.me with the finest TI-Nspire programs

Offline hoffa

  • Project Author
  • LV6 Super Member (Next: 500)
  • ******
  • Posts: 322
  • Rating: +131/-13
    • View Profile
Re: nSDL (0.1.3 beta)
« Reply #129 on: March 24, 2012, 01:37:29 pm »
It wasn't even -Os, I at first used no optimization (i.e. -O0) for stability purposes and then forgot about it.

Offline hoffa

  • Project Author
  • LV6 Super Member (Next: 500)
  • ******
  • Posts: 322
  • Rating: +131/-13
    • View Profile
Re: nSDL (0.1.4 beta)
« Reply #130 on: March 25, 2012, 09:56:16 am »
Booyakasha!

0.1.4's up. It should actually be 0.1.3b or 0.1.3.0.0.0.1 as it contains very little code changes, but hey, who wants to stay in 0.1.* forever? I'll probably jump to 0.2.0 once I get the mouse to work, just for shits'n'giggles.

Anyway, basically this version goes hand in hand with the new how-to guide. First of all I hid that whole NSP_COLOR_LCD thing from the user as it complicates the build process and whatnot. Then I added a very easily adaptable Makefile.sample file to the final archive which simplifies the build a lot (only a make cx/tc is needed to build now, no more cryptic commands). Also I added a primitive README file to the said archive; it doesn't really help anything at all (who reads README's anyway?) but it makes it look more serious. Then I did some general housekeeping to the code and removed some mouse-related test stuff clogging up the event loop. Oh and as I mentioned a few sentences earlier, I updated the how-to guide.

There won't be any updates for at least a few days as this version has been clinically proven through rigorous scientific experiments to be a "stable beta".

Have fun.

EDIT: Added images of the available fonts.
« Last Edit: March 25, 2012, 11:42:02 am by hoffa »

Offline atiatinini

  • LV1 Newcomer (Next: 20)
  • *
  • Posts: 19
  • Rating: +0/-0
    • View Profile
Re: nSDL (0.1.4 beta)
« Reply #131 on: March 25, 2012, 10:29:57 am »
Just wondering, is it possible to use c++?
Great work! :)

Offline hoffa

  • Project Author
  • LV6 Super Member (Next: 500)
  • ******
  • Posts: 322
  • Rating: +131/-13
    • View Profile
Re: nSDL (0.1.4 beta)
« Reply #132 on: March 25, 2012, 10:38:12 am »
Quote from: libsdl.org
SDL is written in C, but works with C++ natively

So yes, but then again we need to get C++ to work (tangrs was working on it IIRC). So once there's C++, there's SDL C++.

Offline atiatinini

  • LV1 Newcomer (Next: 20)
  • *
  • Posts: 19
  • Rating: +0/-0
    • View Profile
Re: nSDL (0.1.4 beta)
« Reply #133 on: March 27, 2012, 02:38:49 pm »
I've been trying to port some SDL Demos (here), but most of them use math functions that won't work with SDL. For example:
Spoiler For Spoiler:
#include <os.h>
#include <math.h>

int main(void) {
    printf("calculating sqrt... ");
    int n = sqrt(123);
    printf("done!");
    return 0;
}
This code runs ok, but if I add SDL_Init like this:
Spoiler For Spoiler:
#include <os.h>
#include <SDL/SDL.h>
#include <math.h>

int main(void) {
    printf("calculating sqrt... ");
    int n = sqrt(123);
    printf("done!");

    SDL_Init(SDL_INIT_VIDEO);

    SDL_Quit();

    return 0;
}
It stops with this warning:


I asked hoffa about this but he also doesn't know what's causing the warning. Any help?
« Last Edit: March 27, 2012, 02:39:13 pm by atiatinini »

Offline hoffa

  • Project Author
  • LV6 Super Member (Next: 500)
  • ******
  • Posts: 322
  • Rating: +131/-13
    • View Profile
Re: nSDL (0.1.4 beta)
« Reply #134 on: March 27, 2012, 03:34:05 pm »
Indeed it's a rather strange problem. I tried removing all code from SDL_Init() and just returning 0, but it still gives the mentioned error, whether it is called before or after the sqrt() function. However, what I noticed was that it works with no issues when using functions that do not return floating point types, such as ceil(). I'm not sure why it works without the SDL_Init() and doesn't if it is there (in one case the whole SDL lib is linked, in the other not; might have something to do with that), but it might be a Newlib issue, as the Hackspire wiki suggests:
Quote
Compatibility of Ndless with Newlib has not been tested. You may get definition conflicts and crashes due to Newlib running without the required relocation that Ndless doesn't provide. You should always build your programs with the nspire-ld flag -nostdlib, except if you need the single precision floating-point helper functions internally called by GCC when required (__aeabi_fadd, ...).