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

0 Members and 1 Guest are viewing this topic.

Offline Adriweb

  • Editor
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1708
  • Rating: +229/-17
    • View Profile
    • TI-Planet.org
Re: SDL for the TI-Nspire
« Reply #90 on: March 11, 2012, 09:08:42 am »
non-CX working too ?

Awesome :D
My calculator programs
TI-Planet.org co-admin.
TI-Nspire Lua programming : Tutorials  |  API Documentation

Offline hoffa

  • Project Author
  • LV6 Super Member (Next: 500)
  • ******
  • Posts: 322
  • Rating: +131/-13
    • View Profile
Re: SDL for the TI-Nspire
« Reply #91 on: March 11, 2012, 09:15:02 am »
Indeed, yeah. Damn sweet.



Here's the todo list from the README, so you can see what's still left to do:
Code: [Select]
Todo:
- Add SDL_GetTicks() for CX
- Map more keys to SDLKs
- Add support for diagonal arrow keys in events & joystick
- Should the joystick continuously fire events if an arrow key is held down?
- Put all the compiled objects in one folder, along with libSDL.a?
- Add some own function to load images stored in arrays (?)
- Add mouse support
A few of those are trivial to do, but as you can see there's not much left before a beta, if everything goes well and if I don't find any other issues.
« Last Edit: March 11, 2012, 10:09:29 am by hoffa »

Offline Lionel Debroux

  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2135
  • Rating: +290/-45
    • View Profile
    • TI-Chess Team
Re: SDL for the TI-Nspire
« Reply #92 on: March 11, 2012, 10:33:12 am »
IOW, you made the same thing for Clickpad/Touchpad ? :)
Member of the TI-Chess Team.
Co-maintainer of GCC4TI (GCC4TI online documentation), TILP and TIEmu.
Co-admin of TI-Planet.

Offline hoffa

  • Project Author
  • LV6 Super Member (Next: 500)
  • ******
  • Posts: 322
  • Rating: +131/-13
    • View Profile
Re: SDL for the TI-Nspire
« Reply #93 on: March 11, 2012, 11:19:19 am »
Yes, or more generally, I fixed most of the blitting issues. Here's a short video so you can more or less see how blitting a big image runs speed-wise:



EDIT: I actually forgot to pass the surface through SDL_DisplayFormat() to convert to the screen's pixel format. With SDL_DisplayFormat() it's a lot snappier.

EDIT2: Here's another video that gives a better impression of the blitting speed (and seems like there are some issues with timers I need to fix):

« Last Edit: March 11, 2012, 05:15:35 pm by hoffa »

Offline hoffa

  • Project Author
  • LV6 Super Member (Next: 500)
  • ******
  • Posts: 322
  • Rating: +131/-13
    • View Profile
Re: SDL for the TI-Nspire
« Reply #94 on: March 12, 2012, 04:07:56 pm »
While I'm dealing with the timer stuff, I decided to implement fonts. There are 4 fonts included by default, but it's easily extensible. See for yourself:



Drawing fonts is as easy as calling the SDL_NSP_DrawString() function (any TI-Nspire-specific functions I add will be prefixed with SDL_NSP_*).
« Last Edit: March 12, 2012, 04:09:29 pm by hoffa »

Offline njaddison

  • LV4 Regular (Next: 200)
  • ****
  • Posts: 176
  • Rating: +24/-27
    • View Profile
Re: SDL for the TI-Nspire
« Reply #95 on: March 12, 2012, 06:41:21 pm »
While I'm dealing with the timer stuff, I decided to implement fonts. There are 4 fonts included by default, but it's easily extensible. See for yourself:



Drawing fonts is as easy as calling the SDL_NSP_DrawString() function (any TI-Nspire-specific functions I add will be prefixed with SDL_NSP_*).

Is nSDL far enough to start porting SDL programs to the nspire? Or do you need to do more work? (I know nothing about SDL, so I have no clue what you have to do to finish it) Also, could I put custom fonts off of my computer on my nspire using nSDL without having to make the font over again?

Yes, or more generally, I fixed most of the blitting issues. Here's a short video so you can more or less see how blitting a big image runs speed-wise:



EDIT: I actually forgot to pass the surface through SDL_DisplayFormat() to convert to the screen's pixel format. With SDL_DisplayFormat() it's a lot snappier.

EDIT2: Here's another video that gives a better impression of the blitting speed (and seems like there are some issues with timers I need to fix):



Also, the video isn't showing, maybe it's because youtube is blocked at my school? I had no problem viewing youtube videos off of omnimaga before...
« Last Edit: March 12, 2012, 06:44:13 pm by njaddison »
<a href="http://www.nerdtests.com/ft_nt2.php">
<img src="http://www.nerdtests.com/images/badge/nt2/5f42ec78e054645d.png" alt="NerdTests.com says I'm a Highly Dorky Nerd God.  Click here to take the Nerd Test, get geeky images and jokes, and talk to others on the nerd forum!">
</a>


Offline hoffa

  • Project Author
  • LV6 Super Member (Next: 500)
  • ******
  • Posts: 322
  • Rating: +131/-13
    • View Profile
Re: SDL for the TI-Nspire
« Reply #96 on: March 12, 2012, 06:52:57 pm »
Is nSDL far enough to start porting SDL programs to the nspire? Or do you need to do more work? (I know nothing about SDL, so I have no clue what you have to do to finish it) Also, could I put custom fonts off of my computer on my nspire using nSDL without having to make the font over again?
I wouldn't say it is yet. Depends what programs of course, but a few crucial things are missing, and it needs some testing (but that's when it comes to porting more sophisticated programs in the current state; writing your own shouldn't be that big of an issue though). Also many programs use floating point math, and it doesn't seem like Ndless in its current states supports any of that. I'd say if everything goes nicely there might be an early beta at the end of the week.

Also, the video isn't showing, maybe it's because youtube is blocked at my school? I had no problem viewing youtube videos off of omnimaga before...
Yeah it's just you, the video works.
« Last Edit: March 12, 2012, 06:54:18 pm by hoffa »

Offline calc84maniac

  • eZ80 Guru
  • Coder Of Tomorrow
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2898
  • Rating: +467/-17
    • View Profile
    • TI-Boy CE
Re: SDL for the TI-Nspire
« Reply #97 on: March 12, 2012, 07:30:42 pm »
I'm pretty sure the GCC we use supports floating point. Of course, it can be slow since the floating point math has to be emulated with integer instructions.
"Most people ask, 'What does a thing do?' Hackers ask, 'What can I make it do?'" - Pablos Holman

Offline Chockosta

  • LV6 Super Member (Next: 500)
  • ******
  • Posts: 447
  • Rating: +169/-6
    • View Profile
Re: SDL for the TI-Nspire
« Reply #98 on: March 13, 2012, 10:59:01 am »
Floating point operations work.
But floating point numbers can't be displayed with printf("%f") or sprintf("%f").

Offline hoffa

  • Project Author
  • LV6 Super Member (Next: 500)
  • ******
  • Posts: 322
  • Rating: +131/-13
    • View Profile
Re: SDL for the TI-Nspire
« Reply #99 on: March 15, 2012, 03:14:14 pm »
Alrighty guys, I'm happy to announce the first beta version of SDL for the TI-Nspire will come out very soon. :)

But before I can do that, I need someone to check one thing on their physical CX. It's everything but complicated; download the attachment, send it to your calculator and enjoy the nice fonts and just observe how the timer increases. It should output the number of milliseconds since SDL initialization, so it should increase at a rate of 1000 a second. Press any key to update that value. If it increases way too fast, just tell me. That's all I need you to do, it should take just a few seconds. Thank you a lot for whoever helps me; the faster I get the info the faster I can release SDL. :)

I've made quite a few changes since last update. I changed to a much faster, more flexible and cleaner font system, updated the timer stuff, fixed some issues and whatnot.
« Last Edit: March 15, 2012, 03:14:55 pm by hoffa »

Offline atiatinini

  • LV1 Newcomer (Next: 20)
  • *
  • Posts: 19
  • Rating: +0/-0
    • View Profile
Re: SDL for the TI-Nspire
« Reply #100 on: March 15, 2012, 03:35:02 pm »
It's working very well, and the timer is very accurate! :D

Offline hoffa

  • Project Author
  • LV6 Super Member (Next: 500)
  • ******
  • Posts: 322
  • Rating: +131/-13
    • View Profile
Re: SDL for the TI-Nspire
« Reply #101 on: March 15, 2012, 03:42:53 pm »
It's working very well, and the timer is very accurate! :D
Good to hear, seems like the problem's only on the non-CX models then (the value increases at the speed of light). Once I finish studying I'll go and beat the crap out of that timer bug, do some housekeeping and release the beta (very probably tomorrow, unless I once again end up going to bed at around 1 AM). Thanks again.

EDIT: I'll probably make some how-to thread for those new to SDL with instructions, links to tutorials and such things once something's ready.

EDIT2: Just released TI-Nspire SDL 0.1.0. :)
« Last Edit: March 15, 2012, 06:32:19 pm by hoffa »

Offline hoffa

  • Project Author
  • LV6 Super Member (Next: 500)
  • ******
  • Posts: 322
  • Rating: +131/-13
    • View Profile
Re: nSDL (0.1.1 beta)
« Reply #102 on: March 16, 2012, 11:37:39 am »
Just finished rewriting the thread, it's still missing a lot of things (how-to, screenshots, etc.) but it's a nice start.

Also removed yesterday's 0.1.0, as it was missing the headers and still had the old clumsy SDL_NSP_* functions. So I quickly rolled out 0.1.1, that'll be the starting point. I haven't written any instructions yet, but those who know their way around SDL and static libraries can already start playing around with it. :) I also renamed the project to nSDL; I wasn't to fond of the n-prefix, but TI-Nspire SDL just seemed too massive, so nSDL it is then.

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.0 beta)
« Reply #103 on: March 16, 2012, 11:38:49 am »
Very nice!

Need to see to test this when I installed Ndless (again) on my CX :)

Offline alberthrocks

  • Moderator
  • LV8 Addict (Next: 1000)
  • ********
  • Posts: 876
  • Rating: +103/-10
    • View Profile
Re: nSDL (0.1.1 beta)
« Reply #104 on: March 16, 2012, 11:57:39 am »
Once again, great job! You've worked really hard :D
Withgusto Networks Founder and Administrator
Main Server Status: http://withg.org/status/
Backup Server Status: Not available
Backup 2/MC Server Status: http://mc.withg.org/status/


Proud member of ClrHome!

Miss my old signature? Here it is!
Spoiler For Signature:
Alternate "New" IRC post notification bot (Newy) down? Go here to reset it! http://withg.org/albert/cpuhero/

Withgusto Networks Founder and Administrator
Main Server Status: http://withg.org/status/
Backup Server Status: Not available
Backup 2/MC Server Status: http://mc.withg.org/status/

Activity remains limited due to busyness from school et al. Sorry! :( Feel free to PM, email, or if you know me well enough, FB me if you have a question/concern. :)

Don't expect me to be online 24/7 until summer. Contact me via FB if you feel it's urgent.


Proud member of ClrHome!

Spoiler For "My Projects! :D":
Projects:

Computer/Web/IRC Projects:
C______c: 0% done (Doing planning and trying to not forget it :P)
A_____m: 40% done (Need to develop a sophisticated process queue, and a pretty web GUI)
AtomBot v3.0: 0% done (Planning stage, may do a litmus test of developer wants in the future)
IdeaFrenzy: 0% done (Planning and trying to not forget it :P)
wxWabbitemu: 40% done (NEED MOAR FEATURES :P)

Calculator Projects:
M__ C_____ (an A____ _____ clone): 0% done (Need to figure out physics and Axe)
C2I: 0% done (planning, checking the demand for it, and dreaming :P)