basicprogramming.org


Welcome, Guest. Please login or register.
Did you miss your activation email?
Forum time; Jul 31. 2010, 03:43
Home Help Search Calendar Login Register
News: Have you got suggestions for BasicProgramming.org? Let's hear them!
Interested in creating your own programming language? Check out the QDepartment group!

+  BASIC programming forum
|-+  Interpreter Development
| |-+  yaBasic development forum. (Moderator: Thomas Larsen)
| | |-+  Graphics question
0 Members and 1 Guest are viewing this topic. « previous next »
Pages: 1 [2] Go Down Reply Print
Author Topic: Graphics question  (Read 399 times)
Thomas Larsen
Administrator
Sr. Member
*****
Offline Offline

Posts: 255



WWW
« Reply #15 on: Dec 16. 2009, 14:38 » Reply with quote

By the way, I forgot to mention: modules/plugins should have some kind of internal "exit" function which is called when Yabasic exits. In the case of the SDL module above, it would close any open windows and perform other similar tasks; in the case of a Curses module, it would return the window to standard input-output mode; and so on. The exit function corresponding to every module/plugin loaded by Yabasic would be called when Yabasic exited.
Report to moderator   Logged

aurelB
Hero Member
*****
Offline Offline

Posts: 663



WWW
« Reply #16 on: Dec 16. 2009, 15:03 » Reply with quote

First this thing dont look logical to me
Quote
module "sdl" as sdl
maby :
Code:
module "sdl" As Gui
or
module "win" As Gui
or
module "gtk" As Gui

and ...
Quote
red = sdl.openwindow (100, 100, "Red Circle")

whay not ...
Code:
sdl.openwindow (red,100, 100, "Red Circle")
....
red.color (255, 0, 0)
red.circle (50, 50, 25)

of course your way reminds me on
hwnd = CreateWindowExA ....  win api function
which is ok for me Wink
Report to moderator   Logged

Thomas Larsen
Administrator
Sr. Member
*****
Offline Offline

Posts: 255



WWW
« Reply #17 on: Dec 16. 2009, 15:11 » Reply with quote

First this thing dont look logical to memaby :
Code:
module "sdl" As Gui
or
module "win" As Gui
or
module "gtk" As Gui

Any of these would be possible. The "as ..." part would simply specify an "identifier", or prefix, for the module.

whay not ...
Code:
sdl.openwindow (red,100, 100, "Red Circle")
....
red.color (255, 0, 0)
red.circle (50, 50, 25)

I'm not sure how this could be done easily without making complicated alterations to Yabasic, because I envision openwindow () returning a unique numerical identifier (like open () does) which could be used to reference the newly-opened window. For example:

Code:
module "sdl" as gui

dim windows (10)

for open_windows = 1 to 10
   windows (open_windows) = gui.openwindow (100, 100, "Window Number " + str$ (open_windows))
next

Does that make sense?

Cheers,
Thomas
Report to moderator   Logged

flo
Newbie
*
Offline Offline

Posts: 6


« Reply #18 on: Feb 07. 2010, 13:16 » Reply with quote

i think smfl is the best option, because there you have some Network features too.
Report to moderator   Logged
gersen
Sr. Member
****
Offline Offline

Posts: 348


« Reply #19 on: Mar 09. 2010, 05:30 » Reply with quote

Has it been decided yet whether to use the old graphics commands or go the "functions" route ? Having had a quick look at a plugin for SFML, I can see where Thomas is coming from, and how it could make life a lot easier for Psnake.

I probably wont get to attempt an SFML plugin, at least in the near future, but can see where the "functions" route would allow a relatively painless addition with it's own commands.

Don't see any need for backwards compatibility, we've all got the old Yabasic binaries to run older programs.

Edit: Just corrected my grammar.



« Last Edit: Mar 09. 2010, 06:00 by gersen » Report to moderator   Logged
Pages: 1 [2] Go Up Reply Print 
« previous next »
Jump to:  
Atom RDF RSS 0.91 RSS 2.0


Login with username, password and session length

Powered by MySQL Powered by PHP Powered by SMF 1.1.11 | SMF © 2006-2008, Simple Machines LLC Valid XHTML 1.0! Valid CSS!