Dear All,
I am in the process of writing a kind of universal renderer for the TI nSpire (for the GUI Toolkit NF) and then I need to write some methods able to translate the drawcalls either to SDL or to nGc.
Most of the primitives are now working great (pixels (read/write) / main blitting functions / line, rectangle, circle ...).
I need to create a function for sprites and hence try to understand the data structure of gui_gc_Sprite.
I know there are 3 members :
short width;
short height;
char * pixels;
but what is the convention used for the "pixels" member ?
On the CX/CX-II, the color screen uses 16bits (565 coding) so a pixel color should be coded on a short rather than on a char. Looking at some example in the ndless_sdk, it does not seem to use 3 values per pixel (there are not 3 char per actual pixel). It does not seem either to be using a palette (or I do not know where it is defined).
Right now I have my raw data in a table of unsigned short, each pixel coded on a 16bit value as per the 565 convention, How can I make it compatible with gui_gc_Sprite ?
I hope someone will be able to help.
BR
Sly
Need help with nGc "gui_gc_Sprite" structure
3 posts
• Page 1 of 1

Need help with nGc "gui_gc_Sprite" structure
Some works in progress :
The GUI Toolkit NF for nSpire | MyShmup for fxCG-50 | Magic Light for Casio Graph 90+E and Magic Light for nSpire CX/CX-II | Simple Text Editor for nSpire | OutRun for Casio Graph 90+E |
![]() | ![]() | ![]() | ![]() | ![]() |
And more to come ... stay tuned
-
SlyVTTPremium
Niveau 12: CP (Calculatrice sur Pattes)- Posts: 547
- Images: 32
- Joined: 19 Jan 2021, 09:41
- Location: France
- Gender:
- Calculator(s):→ MyCalcs profile
- GitHub: SlyVTT
Re: Need help with nGc "gui_gc_Sprite" structure
Hi,
I remember using ngc some time ago, and I think that pixels should be 8bits colors for each pixel.
These colors are represented in this image :
I remember using ngc some time ago, and I think that pixels should be 8bits colors for each pixel.
These colors are represented in this image :

-
Ti64CLi++Modo
Niveau 16: CC2 (Commandeur des Calculatrices)- Posts: 3446
- Images: 75
- Joined: 04 Jul 2014, 14:40
- Location: Clermont-Ferrand 63
- Gender:
- Calculator(s):→ MyCalcs profile
- Class: ENS Rennes
- GitHub: Ti64CLi

Re: Need help with nGc "gui_gc_Sprite" structure
Hello Ti64CLi++
thanks for your feedback. I guess you are right, it seems that that structure uses a kind of "hidden" palette somewhere. So I cannot use it directly as I am using RGB coding for each pixel.
A better choice seems to be using TI_Image format and the corresponding gui_gc_drawImage function but, it does not seem to be able to consider transparency.
So I wrote a structure from scratch, able to handle sprite data either for SDL and for nGc (through conditional compiling) and integration of transparency.
I dropped the question to Vogtinator/Ndless team on the github repository, if a detailed answer comes, I will post it here.
BR
Sly
thanks for your feedback. I guess you are right, it seems that that structure uses a kind of "hidden" palette somewhere. So I cannot use it directly as I am using RGB coding for each pixel.
A better choice seems to be using TI_Image format and the corresponding gui_gc_drawImage function but, it does not seem to be able to consider transparency.
So I wrote a structure from scratch, able to handle sprite data either for SDL and for nGc (through conditional compiling) and integration of transparency.
I dropped the question to Vogtinator/Ndless team on the github repository, if a detailed answer comes, I will post it here.
BR
Sly
Some works in progress :
The GUI Toolkit NF for nSpire | MyShmup for fxCG-50 | Magic Light for Casio Graph 90+E and Magic Light for nSpire CX/CX-II | Simple Text Editor for nSpire | OutRun for Casio Graph 90+E |
![]() | ![]() | ![]() | ![]() | ![]() |
And more to come ... stay tuned
-
SlyVTTPremium
Niveau 12: CP (Calculatrice sur Pattes)- Posts: 547
- Images: 32
- Joined: 19 Jan 2021, 09:41
- Location: France
- Gender:
- Calculator(s):→ MyCalcs profile
- GitHub: SlyVTT
3 posts
• Page 1 of 1
Return to Native: Ndless, Linux, ...
Who is online
Users browsing this forum: ClaudeBot [spider] and 6 guests