[In Development]Programming Windows with PAWN!
#19

Quote:
Originally Posted by [GF]Sasino97
View Post
I don't mean to wrap the entire API LoL.
I want to wrap the most useful functions, because PAWN is 10 times easier than any other Hi-Level programming language. I'm planning to simplify it by editing pawncc.exe too (The compiler). Then when It'll be ready, it will be super-useful for making Games
I'm planning this for beginners, and for people of SA-MP Forums that already know a lot of PAWN, but no other lang.
I've been thinking, and there's a few things you should think about. Please dont get discouraged by this, or think im trying to undermine the project (im actually fond of the project idea - anything that uses PAWN is cool ). These are just some things you need to think about before you put in a TON of work into the project though.
  • Compatability
    • Since you're using the WIN32 API any apps built will only work on windows.
  • UI controls
    • As it stands right now you have a few controls (or widgets) implemented, but your already missing a lot of useful things (understandable if your new to creating programs with GUI). Lets take buttons for example (CreateButton). At the moment you can only create a button with TEXT (no icons), you cant make them checkable, and you only have a press event (More on the event system issues later). You might be thinking "You're just nitpicking- this is in development man, ofc im gonna miss stuff" but that is not the point im trying to make here. The problem with doing something of this magnitude in PAWN is pretty straight forward- the more you offer users, the more bloated and complicated it gets. PAWN doesnt offer function overloading, nor OOP, so you're gonna have to either add a lot of optional parameters or add more functions (both bloat and complicate).
  • Absolute positioning
    • If you look at CreateButton again (to keep it consistent), you'll notice that it has geometry parameters (x,y,w,h). Creating applications using coordinates is a major headache, you have to GUESS where your going to place your widgets and adjust the values until its correct. This also means that your application's size can not be adjusted (it wont scale), and any updates to the design is gonna cost you serious time! Layouts are definitely something you should add to avoid all these problems (Vertical, Horizontal, Group layouts + spacer widgets would make development much easier).
  • Events
    • Since the only widgets available are buttons, you probably haven't noticed this. Certain widgets have more than just ONE event so you're gonna have to add another parameter to your event handler callback (an event parameter). This clashes with the current parameter naming- maybe Events(EHource, event) would be a bit better?
  • Event handler
    • Other than the above, there is nothing really wrong with the way you handled events to be honest (its common in procedural languages- hell, look at OnDialogResponse), i just have a suggestion that i think can better the system. At the moment you have a single callback to handle EVERY widget's events based on an event id passed. I see this callback growing to a ridiculous size for applications that use a lot of widgets. Having a ton of if statements that check if the passed ID is equal to a specific widget's id can become a bit overwhelming (that is, if there's a lot of stuff in this 1 callback). PAWN has a neat feature you could be using to make this event system a bit better; Functions and variables that are declared public are visible (by NAME) to the abstract machine. This means that instead of having tons if ID's for widget events and using these ID's in an event handler callback, you can simply simply assign individual callbacks. It would be NO different than timers, which i think is a better solution. Its a matter of preference though of course.
  • PAWN 4.0.4548
    • There have been quite a few changes to the language that most people here arent going to know about. The biggest ones are that enums no longer exist (instead there are now "symbolic indices" to represent structures), and array initialization no longer uses curly brackets (they use square brackets instead now). You should link everyone HERE so they can get used to the changes. You might also want to warn everyone that they have to compile with YOUR compiler (might have to change what the .pwn extension opens with).
  • Games
    • Im not sure why you think this will make creating 2D games any easier. There are tons of libraries out there that handle things like rendering, sound, and input for 2D games (SDL/SFML for example). If anything i think creating a game in a language like PAWN would be a lot harder; Even if you added everything you'd need (which i hope you know is more than just image loading xD). PAWN lacks a lot of the luxuries languages like C++ offer.

Good luck with the project man, its gonna take take some work but im sure some people will appreciate it (i personally will stick with C++/Qt).
Reply


Messages In This Thread
[In Development]Programming Windows with PAWN! - by Sasino97 - 29.09.2011, 14:04
Re: [In-Dev App]WinPAWN - Win32 API to PAWN! (It's not working with SA-MP) - by Kyosaur - 29.09.2011, 14:53
Re: [In-Dev App]WinPAWN - Win32 API to PAWN! (It's not working with SA-MP) - by suhrab_mujeeb - 29.09.2011, 14:57
Re: [In-Dev App]WinPAWN - Win32 API to PAWN! (It's not working with SA-MP) - by Gamer_Z - 29.09.2011, 15:04
Re: [In-Dev App]WinPAWN - Win32 API to PAWN! (It's not working with SA-MP) - by Lorenc_ - 29.09.2011, 15:13
Re: [In-Dev App]WinPAWN - Win32 API to PAWN! (It's not working with SA-MP) - by Sasino97 - 30.09.2011, 12:59
Re: [In-Dev App]WinPAWN - Win32 API to PAWN! (It's not working with SA-MP) - by Sasino97 - 02.10.2011, 07:49
Re: [In Development]Programming Windows with PAWN! - by Hiddos - 02.10.2011, 09:02
Re: [In Development]Programming Windows with PAWN! - by Sasino97 - 02.10.2011, 09:07
Respuesta: [In Development]Programming Windows with PAWN! - by kirk - 02.10.2011, 11:58
Re: [In Development]Programming Windows with PAWN! - by saiberfun - 02.10.2011, 12:00
Re: [In Development]Programming Windows with PAWN! - by JernejL - 02.10.2011, 12:47
Re: [In Development]Programming Windows with PAWN! - by Schurman - 02.10.2011, 15:29
Re: [In Development]Programming Windows with PAWN! - by KoczkaHUN - 02.10.2011, 17:52
Re: [In Development]Programming Windows with PAWN! - by SkizzoTrick - 02.10.2011, 18:18
Re: [In Development]Programming Windows with PAWN! - by Kush - 02.10.2011, 18:19
Re: [In Development]Programming Windows with PAWN! - by Gamer_Z - 02.10.2011, 21:41
Re: [In Development]Programming Windows with PAWN! - by Y_Less - 02.10.2011, 22:25
Re: [In-Dev App]WinPAWN - Win32 API to PAWN! (It's not working with SA-MP) - by Kyosaur - 02.10.2011, 22:28
Re: [In Development]Programming Windows with PAWN! - by Toni - 02.10.2011, 23:00
Re: [In Development]Programming Windows with PAWN! - by Ricop522 - 03.10.2011, 01:36
Re: [In Development]Programming Windows with PAWN! - by Vai_Besta - 03.10.2011, 02:43
Re: [In Development]Programming Windows with PAWN! - by Paramount. - 03.10.2011, 18:26
Re: [In Development]Programming Windows with PAWN! - by [GF]Sasino97 - 03.10.2011, 19:24
Re: [In Development]Programming Windows with PAWN! - by [GF]Sasino97 - 06.10.2011, 10:28
Re: [In Development]Programming Windows with PAWN! - by Vai_Besta - 10.10.2011, 21:39
Re: [In Development]Programming Windows with PAWN! - by Ricop522 - 11.10.2011, 01:59

Forum Jump:


Users browsing this thread: 4 Guest(s)