Calculator Community > nSDL

Frequently Asked Questions

(1/3) > >>

hoffa:

* What is nSDL?
nSDL is a port of the widely used, cross-platform and open source SDL graphics library for the Ndless-fueled TI-Nspire.


* What is SDL?
According to Wikipedia, "SDL acts as a thin, cross-platform wrapper, providing support for 2D pixel operations, sound, file access, event handling, timing, threading, and more." It's basically a graphics library with event handling, timing and other nice little things.


* Where can I download nSDL?
On the nSDL website.


* How do I install/use nSDL?
Copy lib and include folders' content in the nSDL package to the respective folders in your Ndless SDK folder. To build your nSDL programs, use and adapt the Makefile.sample file.


* Is there some nSDL wiki?
Yeah.


* Which version of SDL is nSDL based on?
1.2.15.


* Do I need to recompile my code for each machine separately?
No, compile it once and it'll work on any of the calculators. If however it doesn't, check out some other part of the code isn't causing the trouble.


* What functionalities of SDL are/aren't supported?
Supported: video, events, SDL_GetTicks()
Not supported: audio, threads, timers, mouse


* Will there ever be mouse support?
Most probably yes. There was partial mouse support in an earlier nSDL version, but it was removed in a later release because the behavior on CX and non-CX calculators was different, making it desperately frustrating to debug as I only have a Touchpad.


* Are SDL_image or SDL_gfx supported?
Yes, both have been ported and can be found here.


* How do I draw text?
Using the included nSDL-exclusive functions. First load the font with whatever color you want using nSDL_LoadFont(), then draw your stuff with nSDL_DrawString(), and finally free the font using nSDL_FreeFont(). Simple as that. Here's an example:

nSDL_Font *font = nSDL_LoadFont(NSDL_FONT_TINYTYPE, 255, 0, 0);
nSDL_DrawString(screen, font, 10, 10, "I love your string, baby.");
nSDL_FreeFont(font);

For more information about the different fonts and available flags, check this page out.


* What are those nSDL-exclusive functions?
Here's a list of them.


* Can I draw text in different sizes?
No.


* How do I use cos(), sin() and other mathematical functions?
Using the ported fdlibm library which can be found here. Just include libfdm.h in your code. It implements all of the functions defined in math.h. Install it the same way as you'd install nSDL. Remember to link fdlibm using the -lfdm switch.


* Can I draw text in different sizes?
No.


* Where do I see which key is mapped to which SDL key value?
Check out the last part of this file for the latest keymap.


* Does it run Crysis?
Yes, the latest tests show that nSDL runs Crysis at about 47 FPS in ultra (note to Fox News: the TI-Nspire doesn't actually run Crysis at 47 FPS). nSDL has been designed with performance in mind.

Matrefeytontias:
Sorry to bother about it again, but in SDL_image, only 3 formats require an external lib to be read : jpeg, tiff and png. Personally, I'd be happy only with gif images :)

hoffa:
Yeah, but JPEG and PNG are by far the most used formats. Also, just partially porting SDL_image wouldn't make it SDL_image anymore, but some dirty stripped spin-off.

Now that I think of it, a trimmed (and possibly renamed, to not confuse the user) version of SDL_image would probably be possible. I'll look into it.

DJ Omnimaga:
I thought nSDL only supported BMP? ???
I guess it's good that it supports other format since BMP is massive when not in 8 bit or lower format.

Matrefeytontias:
Well, nSDL does support only BMP :P that's why someone developed SDL_image, an add-on for SDL.

Navigation

[0] Message Index

[#] Next page

Go to full version