![]() ![]() Now, Open PureBasic (x86 - 32 Bit, we will deal with 64 bit later) and create a project, again call it myPlugin and save it where ever you save your PB stuff, We will worry about what this content means in a bit, lets get something working first. Use the project creation dialog to add a file, call it main.pb and click the 'Create Project' button, this will open the project overview tab. You can add both if you want to compile for both systems but set your preferred as default (I set classic) (checkbox at bottom of compile targets list) and set the other 'Studio' Enable in build all targets, now we can compile our plugin for both Classic and Studio at a single button click, handy stuffĬlick OK in the dialog, you are now greeted with an empty code page, first lets test our compile targets to make sure we got it right, go to the main menu, click Compiler>Build All Targets, a dialog will appear and tell you what's going on, when its done you should now have a new DLL in the plugin folder (you will need to launch PureBasic with admin rights to compile to the Program Files folder) Studio: C:\Program Files (x86)\The Game Creators\AppGameKit Studio\Plugins\myPlugin\Windows.dll Set the input file to the main.pb file that was created with the project and set the output executable to :Ĭlassic: C:\Program Files (x86)\The Game Creators\AGK2\Tier 1\Compiler\Plugins\myPlugin\Windows.dll Now we need to set the compile targets, in the 'Project Targets' list, right click 'Default Target' and click 'Edit Target', this opens the project compiler options. SetOrientationAllowed( 1, 1, 1, 1 ) // allow both portrait and landscape on mobile devices SetVirtualResolution( 1024, 768 ) // doesn't have to match the window SetWindowAllowResize( 1 ) // allow the user to resize the window When AppGameKit loads the plugin it looks for a function 'ReceiveAGKPtr', this function is called by the runtime and sends the full set of function pointers to the plugin, we will setup this function but not use it yet, this function must exist for the plugin to work so we set this us with a C prototype If everything is good, we can add some code, if something went wrong, check each step and try again. There are no bottlenecks like a virtual machine or a code translator, the generated code produces an optimized executable.SetScissor( 0,0,0,0 ) // use the maximum available screen space, no black borders SetSyncRate( 30, 0 ) // 30fps instead of 60 to save battery ![]() If you need a higher resolution timer, use a multimedia timer or a high-resolution timer. BackupUser PureBasic Guru Posts: 16777133 Joined: Tue 6:42 pm. Otherwise, check for an overflow condition when comparing times. Anyone know of any timer functions in PureBasic. To avoid this problem, use the GetTickCount64 function. This means that the same code can be compiled natively for the OS and use the full power of each. Therefore, the time will wrap around to zero if the system is run continuously for 49.7 days. PureBasic is a portable programming language which currently works on AmigaOS, Linux, MacOS X and Windows computer systems. For the experienced coder, there are no problems gaining access to any of the legal OS structures or Windows API objects. The syntax is easy and the possibilities are huge with the ”advanced” functions that have been added to this language like pointers, structures, procedures, dynamic linked-lists and much more. We have put a lot of effort into its realization to produce a fast, reliable and system-friendly language. ![]() Mercurial (Hg) must be installed on you/the user's system. Windows only (not tested on Linux/Mac) ASCII/Unicode safe. Functionality includes creating and committing repos, examining changed files, generating a diff, examining the commit log. This software has been developed for the Windows operating system. This is a Module for interacting with Mercurial ( Hg) SCM. Learning PureBasic is very easy! PureBasic has been created for beginners and experts alike. We've got an MSDN post about it, we've got a StackOverflow answer about it, and even some official sample code that uses custom timers. Because the timer functions are globals, there is no need to call require ('node:timers') to use the API. It is mostly compatible with any other ”BASIC” compiler, whether it’s for the Amiga or PC format. The timer functions within Node.js implement a similar API as the timers. PureBasic is an ”high-level” programming language based on established ”BASIC” rules. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |