Omnimaga: The Coders Of Tomorrow
Welcome, Guest. Please login or register.
 
Omnimaga: The Coders Of Tomorrow
21 May, 2013, 04:22:14 *
Welcome, Guest. Please login or register.

Login with username, password and session length
 
   home   news downloads projects tutorials misc forums rules new posts irc about Login Register  
+-OmnomIRC

You must Register, be logged in and have at least 40 posts to use this shout-box! If it still doesn't show up afterward, it might be that OmnomIRC is disabled for your group or under maintenance.

Note: You can also use an IRC client like mIRC, X-Chat or Mibbit to connect to an EFnet server and #omnimaga.

Pages: 1 2 [3] 4   Go Down
  Print  
Author Topic: [nRGBlib] W.I.P - Colorful librairy for Ndless 3.1 -  (Read 5164 times) Bookmark and Share
0 Members and 1 Guest are viewing this topic.
lkj
LV6 Super Member (Next: 500)
******
Offline Offline

Gender: Male
Last Login: Yesterday at 22:33:46
Date Registered: 07 September, 2011, 20:05:25
Posts: 349

Total Post Ratings: +40

View Profile
« Reply #30 on: 03 March, 2012, 17:03:04 »
0

the "directory for the tns file" means the name and directory were the compiled .tns will be. For example this line could be

1
DISTDIR = Example.tns

In the OBJS line you have to write the names of the .c files you want to compile, but with .o instead of .c at the end of each name.
So I could put
DISTDIR = C:/ndless/test1/testprogram.tns
?

I'm sorry that I was wrong and didn't answer Sad
It would have to be
DISTDIR = C:/ndless/test1/
but I guess you've figured it out yourself.
Logged

My Nspire Ndless C projects:
epic7
Chopin!
LV11 Super Veteran (Next: 3000)
***********
Online Online

Gender: Male
Last Login: Today at 04:18:45
Date Registered: 22 October, 2011, 01:45:43
Location: Northeast US
Posts: 2165


Total Post Ratings: +118

View Profile
« Reply #31 on: 05 March, 2012, 22:49:45 »
0

Nope. Never got rand() to compile.

Also, I guess I'll just make my sprites out of shapes for now. Tongue
« Last Edit: 05 March, 2012, 22:49:51 by epic7 » Logged



Current Projects:
TitleLanguageProgressStatus
DrillMiner    C (ndless)   35%         Active
?     C (ndless)   0%        Unconfirmed

Spoiler for Programming languages I currently know:
Java (Learning in AP Comp Sci)
C (Specifically Ndless)
Unity JavaScript
LabView (For FIRST robotics)
z80 ASM (Just a little bit Tongue)
totorigolo
LV2 Member (Next: 40)
**
Offline Offline

Gender: Male
Last Login: 28 April, 2013, 02:07:00
Date Registered: 19 December, 2011, 00:19:11
Location: Bouches-du-Rhône
Posts: 24

Topic starter
Total Post Ratings: +9

View Profile
« Reply #32 on: 06 March, 2012, 15:14:52 »
0

Do you include <nMATHS.h> ? Otherwise show me your code.

In the current configuration of nRGBlib, it's not very useful to have sprites, because you can create as many shapes as you want, it's very light (for example, a box = int16_t x; + int16_t y; + int16_t w; + int16_t h;). This is why I have not yet implemented sprites so far.

Tell me if my English is bad  Wink
« Last Edit: 06 March, 2012, 15:15:05 by totorigolo » Logged

nRGBlib - A portable graphic library for Nspire !
epic7
Chopin!
LV11 Super Veteran (Next: 3000)
***********
Online Online

Gender: Male
Last Login: Today at 04:18:45
Date Registered: 22 October, 2011, 01:45:43
Location: Northeast US
Posts: 2165


Total Post Ratings: +118

View Profile
« Reply #33 on: 10 March, 2012, 03:36:49 »
0

nMATHS.h doesnt help, heres the code
http://pastebin.com/QfaM34Fc

Also, how do you display integers?
Logged



Current Projects:
TitleLanguageProgressStatus
DrillMiner    C (ndless)   35%         Active
?     C (ndless)   0%        Unconfirmed

Spoiler for Programming languages I currently know:
Java (Learning in AP Comp Sci)
C (Specifically Ndless)
Unity JavaScript
LabView (For FIRST robotics)
z80 ASM (Just a little bit Tongue)
totorigolo
LV2 Member (Next: 40)
**
Offline Offline

Gender: Male
Last Login: 28 April, 2013, 02:07:00
Date Registered: 19 December, 2011, 00:19:11
Location: Bouches-du-Rhône
Posts: 24

Topic starter
Total Post Ratings: +9

View Profile
« Reply #34 on: 10 March, 2012, 20:09:02 »
0

I have no problem with your code.

I've replaced like this:

1
2
        //seed=randnum(seed); //my goal is to give yvel a random value -128 to 128
        seed = randMinMax(-128, 128);
and it works pretty fine.

Can you send me your Makefile ?
« Last Edit: 10 March, 2012, 20:09:12 by totorigolo » Logged

nRGBlib - A portable graphic library for Nspire !
epic7
Chopin!
LV11 Super Veteran (Next: 3000)
***********
Online Online

Gender: Male
Last Login: Today at 04:18:45
Date Registered: 22 October, 2011, 01:45:43
Location: Northeast US
Posts: 2165


Total Post Ratings: +118

View Profile
« Reply #35 on: 10 March, 2012, 21:51:46 »
0

I'd just need to do
yvel=randMinMax(-128, 128)
do do what i need

Makefile

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
GCC = nspire-gcc
LD = nspire-ld
GCCFLAGS = -Os -nostdlib -I"c:/nRGBlib/sdk/include/"
LDFLAGS = -L "c:/nRGBlib/sdk/lib/"
OBJCOPY := "$(shell (which arm-elf-objcopy arm-none-eabi-objcopy arm-linux-gnueabi-objcopy | head -1) 2>/dev/null)"
ifeq (${OBJCOPY},"")
OBJCOPY := arm-none-eabi-objcopy
endif
OBJS = pong.o
DISTDIR = .
vpath %.tns $(DISTDIR)

all: Pong.tns

%.o: %.c
$(GCC) $(GCCFLAGS) -c $<

%.o: %.S
$(GCC) $(GCCFLAGS) -c $<

Pong.tns: $(OBJS)
$(LD) $(LDFLAGS) $^ -o $(@:.tns=.elf) -lRGB
@mkdir -p $(DISTDIR)
$(OBJCOPY) -O binary $(@:.tns=.elf) $(DISTDIR)/$@

clean:
rm -f *.o *.elf
rm -f $(DISTDIR)/Pong.tns
Logged



Current Projects:
TitleLanguageProgressStatus
DrillMiner    C (ndless)   35%         Active
?     C (ndless)   0%        Unconfirmed

Spoiler for Programming languages I currently know:
Java (Learning in AP Comp Sci)
C (Specifically Ndless)
Unity JavaScript
LabView (For FIRST robotics)
z80 ASM (Just a little bit Tongue)
totorigolo
LV2 Member (Next: 40)
**
Offline Offline

Gender: Male
Last Login: 28 April, 2013, 02:07:00
Date Registered: 19 December, 2011, 00:19:11
Location: Bouches-du-Rhône
Posts: 24

Topic starter
Total Post Ratings: +9

View Profile
« Reply #36 on: 11 March, 2012, 01:55:02 »
0

Your Makefile seems to be good.

Quote
I'd just need to do
yvel=randMinMax(-128, 128)
do do what i need
I'm not sure to have understood, but if I have well understood, you're right :

1
2
3
4
5
6
7
8
9
10
11
while (players  == 0)
    {
        //seed++;
        rand();
        if (isKeyPressed(KEY_NSPIRE_CTRL))

        /* ... */

        //seed=randnum(seed); //my goal is to give yvel a random value -128 to 128
        //yvel=seed%257-128;
        yvel=randMinMax(-128, 128);
And I've checked yvel values and they are goods.

Sorry if I'm repeating me, but what is your problem exactly? What is the output of gcc if your code not compile?
Logged

nRGBlib - A portable graphic library for Nspire !
epic7
Chopin!
LV11 Super Veteran (Next: 3000)
***********
Online Online

Gender: Male
Last Login: Today at 04:18:45
Date Registered: 22 October, 2011, 01:45:43
Location: Northeast US
Posts: 2165


Total Post Ratings: +118

View Profile
« Reply #37 on: 11 March, 2012, 05:45:29 »
0

Hm, I'll try it again and I'll show you the error if it fails.

Also, is there a way better than what I currently use to draw things?
My current way is something like:

Loop
{
Draw object
Pause
Do code stuffs
Draw white over object
Update object's coordinates
}

The objects flash a lot with this tho
« Last Edit: 11 March, 2012, 06:45:31 by epic7 » Logged



Current Projects:
TitleLanguageProgressStatus
DrillMiner    C (ndless)   35%         Active
?     C (ndless)   0%        Unconfirmed

Spoiler for Programming languages I currently know:
Java (Learning in AP Comp Sci)
C (Specifically Ndless)
Unity JavaScript
LabView (For FIRST robotics)
z80 ASM (Just a little bit Tongue)
totorigolo
LV2 Member (Next: 40)
**
Offline Offline

Gender: Male
Last Login: 28 April, 2013, 02:07:00
Date Registered: 19 December, 2011, 00:19:11
Location: Bouches-du-Rhône
Posts: 24

Topic starter
Total Post Ratings: +9

View Profile
« Reply #38 on: 12 March, 2012, 20:29:19 »
0

Your way seems good, but I can't help you much better, because I am just a French 15 years old boy who had learned thanks to the SdZ and alone to program Tongue So, nRGBlib's code is surely not optimized at all, and all suggestions / patch / help (/ ...) is obviously the welcome  Wink (→ https://bitbucket.org/totorigolo/nrgblib/issues?status=new&status=open)

The objects flash a lot with this tho

Indeed, I noticed that the ball is flashing a lot. Maybe, you can use drawBox instead of drawDisc to clear the previous ball, because it should be faster...
To draw circles or discs, I currently use Bresenham's algorithm (http://fr.wikipedia.org/wiki/Algorithme_de_trac%C3%A9_d%27arc_de_cercle_de_Bresenham (or in English http://en.wikipedia.org/wiki/Midpoint_circle_algorithm), thanks Excale for the link Smiley), and you can see my implementation here (https://bitbucket.org/totorigolo/nrgblib/src/d999e40ef8af/src/nRGBlib/drawDisc.c). Maybe an (more) optimized version exists.

Anyway, thanks you for your feedback Cheesy
« Last Edit: 12 March, 2012, 20:29:34 by totorigolo » Logged

nRGBlib - A portable graphic library for Nspire !
totorigolo
LV2 Member (Next: 40)
**
Offline Offline

Gender: Male
Last Login: 28 April, 2013, 02:07:00
Date Registered: 19 December, 2011, 00:19:11
Location: Bouches-du-Rhône
Posts: 24

Topic starter
Total Post Ratings: +9

View Profile
« Reply #39 on: 01 April, 2012, 12:06:24 »
0

I am currently adding many new things to nRGBlib, whose images. The system is currently functional, but I have not optimized for the moment only the CX (16bpp), because I absolutely wants to keep compatibility between 16bpp / 4bpp without recompilation, and I'm having some problems with void* pointers ...

So if someone wants to help me in optimizing 4bpp in order to accelerate the next nRGBlib's release.  Smiley

I also plan to open PNG and JPG (because right now the format is one that I created) by integrating the source code of mViewer (for BMP and PNG) and of Nspire and Movie Player (of tangrs) (for JPG), which are released under GPL v2 and v3.
Logged

nRGBlib - A portable graphic library for Nspire !
totorigolo
LV2 Member (Next: 40)
**
Offline Offline

Gender: Male
Last Login: 28 April, 2013, 02:07:00
Date Registered: 19 December, 2011, 00:19:11
Location: Bouches-du-Rhône
Posts: 24

Topic starter
Total Post Ratings: +9

View Profile
« Reply #40 on: 01 April, 2012, 21:24:42 »
+1

Here is an example of nRGBlib's current features.

The map editor is coded in C + + with SFML. It was created thanks to this tutorial.

<a href="http://www.youtube.com/watch?v=J_d_rJuedQc" target="_blank">http://www.youtube.com/watch?v=J_d_rJuedQc</a>
The sample run slower on 4bpp, because of non-optimization.


----

PS: For epic7, I haven't change your code, but I've just added the double-buffering :
<a href="http://www.youtube.com/watch?v=1jgwHlnxkWk" target="_blank">http://www.youtube.com/watch?v=1jgwHlnxkWk</a>
« Last Edit: 01 April, 2012, 21:55:24 by totorigolo » Logged

nRGBlib - A portable graphic library for Nspire !
adriweb
Editor
LV9 Veteran (Next: 1337)
*
Offline Offline

Gender: Male
Last Login: Yesterday at 00:38:33
Date Registered: 13 April, 2011, 18:42:59
Location: South of France
Posts: 1196


Total Post Ratings: +185

View Profile WWW
« Reply #41 on: 01 April, 2012, 21:47:41 »
0

very nice !! Shocked
Logged


TI-Planet.org co-admin.
TI-Nspire Lua programming : Tutorials  |  API Documentation
totorigolo
LV2 Member (Next: 40)
**
Offline Offline

Gender: Male
Last Login: 28 April, 2013, 02:07:00
Date Registered: 19 December, 2011, 00:19:11
Location: Bouches-du-Rhône
Posts: 24

Topic starter
Total Post Ratings: +9

View Profile
« Reply #42 on: 01 April, 2012, 21:56:24 »
0

Thanks you Cheesy

If you want to play, or create your map, you will have to wait  Tongue
  • Image transparancy
  • Delete tiles
  • Open PNG / BMP
  • Optimizations on 4bpp
« Last Edit: 01 April, 2012, 21:59:26 by totorigolo » Logged

nRGBlib - A portable graphic library for Nspire !
totorigolo
LV2 Member (Next: 40)
**
Offline Offline

Gender: Male
Last Login: 28 April, 2013, 02:07:00
Date Registered: 19 December, 2011, 00:19:11
Location: Bouches-du-Rhône
Posts: 24

Topic starter
Total Post Ratings: +9

View Profile
« Reply #43 on: 18 April, 2012, 00:09:33 »
0

nRGBlib v0.3 has just been released.
The main post has been updated.
A new has been published on TI-Planet : http://tiplanet.org/forum/viewtopic.php?p=123024.
Logged

nRGBlib - A portable graphic library for Nspire !
DJ Omnimaga
Retired Omnimaga founder (Site issues must be PM'ed to Netham45, Eeems, Shmibs, Deep Thought and AngelFish, not me.)
Editor
LV15 Omnimagician (Next: --)
*
Online Online

Gender: Male
Last Login: Today at 03:52:40
Date Registered: 25 August, 2008, 07:00:21
Location: Québec (Canada)
Posts: 50207


Total Post Ratings: +2612

View Profile WWW
« Reply #44 on: 18 April, 2012, 00:14:59 »
0

Awesome, nice to see you still working on this Smiley
Logged

Retired 83+ coder, Omnimaga/TIMGUL founder. Now doing power metal music (formerly did electronica)

Follow me on Bandcamp|Facebook|Reverbnation|Youtube|Twitter|Myspace
Pages: 1 2 [3] 4   Go Up
  Print  
 
Jump to:  

Powered by EzPortal
Powered by MySQL Powered by SMF 1.1.18 | SMF © 2013, Simple Machines Powered by PHP
Page created in 0.244 seconds with 30 queries.
Skin by DJ Omnimaga edited from SMF default theme with the help of tr1p1ea.
All programs, games and songs avaliable on this website are property of their respective owners.
Best viewed in Opera, Firefox, Chrome and Safari with a resolution of 1024x768 or above.