QJ.NET | Videos | Forums | iPhone | MMORPG | Nintendo DS | Wii | PlayStation 3 | PSP | Xbox 360 | PC | Downloads | Contact Us
Forums | Gaming News | Videos | Downloads | Today's Posts | Mark Forums Read | Chat | FAQ | Members List | Contact

QJ.net Game Discussion - PSP, Xbox, Wii, PS3, PSP Homebrew, and PSP Guides

Go Back   QJ.net Game Discussion - PSP, Xbox, Wii, PS3, PSP Homebrew, and PSP Guides > Developers Corner > PSP Development, Hacks, and Homebrew > PSP Development Forum
The above video goes away if you are a member and logged in, so log in now!

[WIP/RELEASE] 7WiN - Lua Windowing System

This is a discussion on [WIP/RELEASE] 7WiN - Lua Windowing System within the PSP Development Forum forums, part of the PSP Development, Hacks, and Homebrew category; 7WiN - LUA windowing system Release: 1.00 I was making a shell for the NeoFlash compo, and frankly, it sucked ...

Reply
 
LinkBack Thread Tools
Old 07-07-2007, 06:26 AM   #1

.info
 
Yongobongo's Avatar
 
Join Date: Jun 2006
Location: ACT, Australia
Posts: 1,674
Trader Feedback: 0
Default [WIP/RELEASE] 7WiN - Lua Windowing System

7WiN - LUA windowing system
Release: 1.00



I was making a shell for the NeoFlash compo, and frankly, it sucked
So, i decided i would try my hand at making a GOOD lua windowing system that supported multi-tasking (coroutines), was easy to use and wasn't EXTREMELY slow. I managed to accomplish decent speed and easy-to-use functions
There are a few key features missing (ie. minimize and close buttons, task-bar) but i will hopefully add them soon.

I plan to make a shell out of this for the NeoFlash comp (this is also entered in the Summer Comp 2007) so i'm trying to keep it at good speed.

So far, it has:
  • Coroutines (multi-processing)
  • Window creation
  • Button creation
  • Checkbox creation
  • 'focus' windows by clicking their title-bar
  • Drag windows
  • Cursor creation
Windows are highly customizable, and all colour/image variables are stored in the lua file so you can edit them from within your program.

Todo for next version:
  • Minimize (and button on windows)
  • Maximize
  • Tab bar for launching/minimizing windows
  • Better window closing (and button on windows)
  • Any other stuff i have to fix
Included in the download is a sample.lua, which is commented, aimed at helping you learn to use the library. I recommend using luaplayer 0.16 when using this program, as it has MUCH more free RAM and will be faster.
The sample includes a simple pong game, a crappy paint app, a helloworld (), a music player (it plays a test .xm file from Shine's Snake Game without clipping) and a test window with buttons that do stuff to the window.
I managed to play a 6mb mp3 without clipping while playing the pong demo in the app

It's my first attempt at a windowing system, so please if you find a bug or have an idea to make it better PM me or reply to this thread

Download is attached, and i will update this thread when i release new versions

Enjoy
Attached Files
File Type: rar 7WiN.rar‎ (182.0 KB, 18 views)
__________________

http://www.yongobongo.com
PSN - yongobongo
Yongobongo is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 07-07-2007, 06:41 AM   #2
Enter Custom Title
 
Join Date: Feb 2006
Location: National Front Disco
Posts: 13,063
Trader Feedback: 0
Default

Wow, this looks fun. I'll download it when I get home, thanks!
Moose is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 07-07-2007, 06:50 AM   #3


Developer
 
Join Date: Jun 2006
Posts: 144
Trader Feedback: 0
Default

Only one piece of advice ( as i don't like the concept of windowing systems on PSP), get some better font and windows The graphics suck real bad...
__________________
Adrahil - Software architect and specialist in Reverse Engineering.
Spoiler for Guilt of a Dev:
17:17 < InsertWittyName> Can't pin user error on a dev ;)
17:18 < InsertWittyName> Lesson learnt on both sides I would say.
17:18 < InsertWittyName> You learnt to treat the end-user as a retarded fish.
17:18 < InsertWittyName> They learnt to read readme's ;)

Spoiler for me:
Quote:
17:12 <+dot_blank> are you the long haired pimp ;)
adrahil is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 07-07-2007, 06:54 AM   #4

.info
 
Yongobongo's Avatar
 
Join Date: Jun 2006
Location: ACT, Australia
Posts: 1,674
Trader Feedback: 0
Default

They are drawn by the PSP because it saves ALOT of RAM and i don't want to use a font because it slows down the CPU by like, 30 FPS or something crazy
I know what you mean, because i do like eye-candy myself except i really was looking for speed in this program
__________________

http://www.yongobongo.com
PSN - yongobongo
Yongobongo is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 07-07-2007, 07:01 AM   #5


Developer
 
Join Date: Jun 2006
Posts: 144
Trader Feedback: 0
Default

Consider that: the PSP can run at 333Mhz. The stuff you're making it do does not take that much I think you could use a few little blits somewhere... Try a simple graphic font, maybe...
__________________
Adrahil - Software architect and specialist in Reverse Engineering.
Spoiler for Guilt of a Dev:
17:17 < InsertWittyName> Can't pin user error on a dev ;)
17:18 < InsertWittyName> Lesson learnt on both sides I would say.
17:18 < InsertWittyName> You learnt to treat the end-user as a retarded fish.
17:18 < InsertWittyName> They learnt to read readme's ;)

Spoiler for me:
Quote:
17:12 <+dot_blank> are you the long haired pimp ;)
adrahil is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 07-07-2007, 07:04 AM   #6

.info
 
Yongobongo's Avatar
 
Join Date: Jun 2006
Location: ACT, Australia
Posts: 1,674
Trader Feedback: 0
Default

A bitmap font maybe would be okay, but a truetype font will be too memory-intense.
__________________

http://www.yongobongo.com
PSN - yongobongo
Yongobongo is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 07-07-2007, 07:11 AM   #7
 
Join Date: Sep 2006
Posts: 21
Trader Feedback: 0
Default

Looks nice Yongo! Good job.
Ocean19 is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 07-07-2007, 07:53 AM   #8
 
Join Date: Sep 2006
Location: Finland
Posts: 752
Trader Feedback: 0
Default

With all due respect, what's up with the flood of lua windowing systems? First there was a flood of lua flashers, now windowing systems, what's next?
__________________
[center][B][SIZE="3"]wheeee =:D[/SIZE][/B][/center]
MaTiAz is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 07-07-2007, 01:28 PM   #9
 
Join Date: Dec 2006
Posts: 652
Trader Feedback: 0
Default

Does this app let u like, for example, play a umd game + use the browser at the same time? If it does this will be an excellent app
_-Tiger-_ is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 07-07-2007, 01:53 PM   #10
 
myschoo's Avatar
 
Join Date: Jul 2006
Location: Middle Europe
Posts: 1,281
Trader Feedback: 0
Default

play GAME and use Internet browser?.. no
__________________
[CENTER][SIZE="1"][1 Year QJ Member]
[COLOR="Sienna"][LUA Coder and C Learner][/COLOR]
[URL="http://dl.qj.net/Ball-Revamped-Clone-v.1-PSP-Homebrew-Games/pg/12/fid/15231/catid/195"] [COLOR="SlateGray"][Ball Revamped Clone v0.1][/COLOR] [/URL]
[URL="http://dl.qj.net/Phil-s-Shooting-Range-v0.3-PSP-Homebrew-Games/pg/12/fid/11542/catid/194"] [COLOR="SlateGray"][Phil's Shooting Range v0.3][/COLOR] [/URL]
[URL="http://dl.qj.net/Organization-Apps/pg/12/fid/14248/catid/190"][COLOR="SlateGray"][HideFile PRX v2][/COLOR][/URL]
[URL="http://dl.qj.net/SSR-PRX-v1.1-PSP-Homebrew-Applications/pg/12/fid/14725/catid/151"][COLOR="SlateGray"][SSR PRX v1.1][/COLOR][/URL] [/SIZE][/CENTER]
myschoo is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 07-07-2007, 01:57 PM   #11
 

 
Join Date: Jul 2006
Location: Ridin' With Urza
Posts: 1,950
Trader Feedback: 0
Default

Lets see how long it takes for TacticalPenguin to see this post and call this guy a code thief who stole his idea.
__________________
[CENTER][IMG]http://klick.ws/images/phil.png[/IMG]
[SIZE="6"][B][U][COLOR="RED"]Most baddest mother****er alive.[/COLOR][/U][/B][/SIZE]
[/CENTER]
KKlicK is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 07-07-2007, 02:00 PM   #12
No longer a community member.
 
Join Date: Jun 2006
Location: Nederland
Posts: 3
Trader Feedback: 0
Default

Nice
Savagefreak is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 07-07-2007, 02:12 PM   #13

lol
 
Anti-QuickJay's Avatar
 
Join Date: Aug 2006
Real First Name: Robert
Location: Whittier, CA
Just Played: Madden 10
Posts: 5,791
Trader Feedback: 0
Default

Quote:
Originally Posted by KlicK
Lets see how long it takes for TacticalPenguin to see this post and call this guy a code thief who stole his idea.
I thought youresam was the first one to make one?
Anti-QuickJay is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 07-07-2007, 04:43 PM   #14

.info
 
Yongobongo's Avatar
 
Join Date: Jun 2006
Location: ACT, Australia
Posts: 1,674
Trader Feedback: 0
Default

Quote:
Originally Posted by MaTiAz
With all due respect, what's up with the flood of lua windowing systems? First there was a flood of lua flashers, now windowing systems, what's next?
I know, but i made it mainly for experience so i could make a GOOD shell (i was making one and it sucked)
__________________

http://www.yongobongo.com
PSN - yongobongo
Yongobongo is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 07-07-2007, 04:47 PM   #15

lol
 
Anti-QuickJay's Avatar
 
Join Date: Aug 2006
Real First Name: Robert
Location: Whittier, CA
Just Played: Madden 10
Posts: 5,791
Trader Feedback: 0
Default

If you were making it for "experience" you wouldn't have released it.
Anti-QuickJay is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 07-07-2007, 05:12 PM   #16

.info
 
Yongobongo's Avatar
 
Join Date: Jun 2006
Location: ACT, Australia
Posts: 1,674
Trader Feedback: 0
Default

Quote:
Originally Posted by Anti-QJ
If you were making it for "experience" you wouldn't have released it.
What's wrong with releasing it? Someone may just find it useful.
Am I taking up valuable bytes in the QJ SQL?
__________________

http://www.yongobongo.com
PSN - yongobongo
Yongobongo is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 07-07-2007, 08:12 PM   #17

lol
 
Anti-QuickJay's Avatar
 
Join Date: Aug 2006
Real First Name: Robert
Location: Whittier, CA
Just Played: Madden 10
Posts: 5,791
Trader Feedback: 0
Default

We already have TacticalPinguin's and youresam's and so far they all do the same thing yours does and more.
Anti-QuickJay is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 07-07-2007, 08:32 PM   #18
 
NeilR's Avatar
 
Join Date: Jul 2005
Posts: 7,010
Trader Feedback: 0
Default

.. and there's really nothing wrong with that.

Quote:
Originally Posted by YongoBongo
Am I taking up valuable bytes in the QJ SQL?
No.. all is well. Carry on.
NeilR is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 07-09-2007, 11:37 AM   #19
 
zilog8's Avatar
 
Join Date: Apr 2007
Posts: 6
Trader Feedback: 0
Default

This is pretty cool, i like, but there are a few small tweaks which would make a huge impact on performance:

-You'd get way better performance if you switch over to luaplayer mod4, and use "fastblit" instead of "blit". Just look into it, trust me.

-Dont use so many buffers. do you really *need* separate win.content, win.top, *and* win.window image buffers? thats a lot of overhead per window. It'd probably be better to blit win.top and win.content directly to screen with two separate blits, you'd be doing less blitting overall and you'd reduce memory usage by half.

-You're reblitting every window to screen every loop.very wasteful.Here's a code clip (from a windowing system i toyed with a while back) that might give a better idea:

Code:
--This function creates a new VisibleObject
function VisibleObject.new()
    local new_inst = {}
    setmetatable(new_inst,{__index = VisibleObject})
    new_inst.isVisible = true
    new_inst.drawCount = 2
end

--[[VisibleObject.drawCount: This value (when>0)
causes this object to be drawn, and is == to the number
of frames an update has left to draw + 1. The extra 1 is
to update the screen buffer, incase the next screen:flip
is caused by a different visible object. Thus, for a 1 frame
screen update (the most common), set drawCount = 2 ]]--

--[[VisibleObject.draw(): draws object to screen, if
drawCount merits it (and if the item is visible of course).
Returns true if thescreen should be flipped to show
changes, false if it shouldn't (returns false for
drawCount==1, since in that case we're only updating
the screen-buffer for subsequent screen:flips)]]--

function VisibleObject:draw()
	local drawCount = self.drawCount
	if self.isVisible and drawCount>0 then
		self.drawCount=drawCount-1
		self:drawBody()
		return drawCount~=1
	else 
		return false
	end
end

VisibleObjects = {}

local exampleObject = VisibleObject.new()
exampleObject.tick = --[[whatever function the objects supposed to do each cycle]]--
exampleObject.drawBody = --[[draws itself to the screen]]--
table.insert(VisibleObjects, exampleObject)

while KeepRunning do --main loop
	buttonHandling() --handles the buttons, obviously!
	local flip = false

	Image.startBlit()
	for i,vO in ipairs(VisibleObjects) do
		vO:tick()
		if vO:draw() then
			flip = true
		end
	end
	Image.endBlit()

	if flip then
		screen.waitVblankStart()
		screen.flip()
	end
end

Last edited by zilog8; 07-09-2007 at 12:12 PM..
zilog8 is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 07-09-2007, 12:41 PM   #20
 
Join Date: Aug 2006
Posts: 1,633
Trader Feedback: 0
Default

Klick, I only call people code thieves who actually are code thieves. I talked to yongobongo while he was making this and in fact he was working on it before the first release of Luanux. You don't need to be an ass just because I get mad at people who actually do use/steal my code without my permission.
TacticalPenguin is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 07-09-2007, 01:13 PM   #21
Developer and Tutor.
 
FaT3oYCG's Avatar
 
My Mood: Happy
Join Date: Jul 2007
Real First Name: Craig
Location: Widnes, England
Just Played: Life.
Posts: 1,646
Trader Feedback: 0
Default

i think tp is very reasonable about code theithes and its a good job i didnt steal the code for luanux but at the time i was a complete noob and didnt know anyone but i didnt use the code good job eigh
FaT3oYCG is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 07-09-2007, 03:54 PM   #22
 
Jomann's Avatar
 
Join Date: Aug 2006
Location: Washington
Posts: 758
Trader Feedback: 0
Default

sweet yongobongo ftw i love your work.. im guessing that you compiled the lua, so we cant have any idea how to make stuff like this for our self eh?
__________________
[URL="http://jomann18.deviantart.com/"][IMG]http://img242.imageshack.us/img242/5020/bestsigeveraw1or8.png[/IMG][/URL]
[COLOR=Red][B][SIZE=3][URL="http://jomann18.deviantart.com/"]Hey look its a link to my deviant art maybe you should click it just for kicks eh?[/URL][/SIZE][/B][/COLOR]
Jomann is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 07-09-2007, 08:52 PM   #23
 
zilog8's Avatar
 
Join Date: Apr 2007
Posts: 6
Trader Feedback: 0
Default

its not compiled, that's how i was able to offer suggestions.
zilog8 is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 07-11-2007, 06:09 PM   #24

oh hai thar
 
Da_MerV's Avatar
 
Join Date: Mar 2007
Real First Name: Merv
Posts: 1,128
Blog Entries: 1
Trader Feedback: 0
Default

looks like luashell2, too bad yoursam never finished it.
Da_MerV is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 07-11-2007, 09:11 PM   #25
 
Join Date: Aug 2006
Posts: 1,633
Trader Feedback: 0
Default

It's not luashell2. It's Lua OS2. He skipped it and went to Lua OS3
TacticalPenguin is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 07-12-2007, 06:34 AM   #26
 

 
Join Date: Jul 2006
Location: Ridin' With Urza
Posts: 1,950
Trader Feedback: 0
Default

Quote:
Originally Posted by TacticalPenguin
Klick, I only call people code thieves who actually are code thieves. I talked to yongobongo while he was making this and in fact he was working on it before the first release of Luanux. You don't need to be an ass just because I get mad at people who actually do use/steal my code without my permission.
Detecting sarcasm isn't your strong point.
__________________
[CENTER][IMG]http://klick.ws/images/phil.png[/IMG]
[SIZE="6"][B][U][COLOR="RED"]Most baddest mother****er alive.[/COLOR][/U][/B][/SIZE]
[/CENTER]
KKlicK is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply

Tags
7win , lua , system , windowing , wip or release

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off



All times are GMT -8. The time now is 04:56 AM.



Use of this Web site constitutes acceptance of the TERMS & CONDITIONS and PRIVACY POLICY
Copyright © 2009, QJ.NET. All Rights Reserved.
Contact Us