Jump to content

Wchris

Members
  • Posts

    281
  • Joined

  • Last visited

Everything posted by Wchris

  1. well is ask here in the c++ forum because the pascal forum is empty so i have more change to get an answer here. But in fact i'm trying to create a delphi component for LE. Components are 'event driven objects' like in the screenshot so you see the keydown event launches the Formkeydown method where you get the key. So if i want to write my own component i have to be able to send the key that was pressed to the event method. understood ?
  2. Hello, First, i don't want to use keyhit/keydown because the command requires me to know what key will be pressed. I don't want to specify what key was pressed. Instead i want to use GETCHAR to get the keycode that was pressed and launch an event. Some kind of callback that would launch if any key was pressed, and then tell me what key it was. but if i say : key = GetChar(); if (key==KEY_A) { DoSomething(); } it works and if i say : key = GetChar(); if (key==KEY_UP) { DoSomething(); } it doesn't i can't get GETCHAR to work with special keys. A i doing something wrong ? i saw masterxilo using hooks and callbacks in the old forum to achieve this http://forum.leadwerks.com/viewtopic.php?f=2&t=3236&p=28267&hilit=hook#p28267 but his solution is not cross platform, so i would prefer a pure LE GETCHAR solution. Any idea ? Thank you
  3. That's very true Rick, the main bottleneck in performance is the programmers coding ability. I can prove this easily ... "Vista is written in C++" But ok, very skilled programmers will squeeze out more fps out of c++, but not much more that a skilled blitzmax programmer ... the problem is non skilled programmers choose blitzmax or other compiled languages because they look simpler to use than c++, they will produce slower unoptimized code and make you think it's the language fault, but it is not. Once compiled in machine code there's not a big difference in performance like naugthy alien said. Nevertheless low skilled programmers will have access to a large cut & paste library of code shared by the many users of c++, and much more help in forums. So C++ is still a language of choice. And if you want to integrate external API like Raknet or a SQL database ... it'll be easyer to find headers and help with C++, but that's not a matter of performance. The performance is boosted by the help you get. Help is important, because the more help you get from skilled programmers, the more you'll be able to produce optimized code, they will show you how to. That's the main advantage of C++. Of course Lua is not compiled, so it'll be slower, like all interpreted languages.
  4. Noone sofar posted differences in FPS between c++ and blitzmax or Lua. I suppose it's because there is no difference or negligible. But i would be happy to see someone prove me wrong and write samples in each language to compare FPS The language won't allow you to write bad unoptimized code and still get performance. For example, i have read somewhere that Josh pointed out we should avoid calling LE engine commands that browse lists in the main loop. What i want to say is that what will have the most influence on FPS is the way you code, not the language you use. Also, i'm currently experimenting postfilter shaders, and i can tell you that poorly written shaders can drop FPS like hell whatever language you use in main program.
  5. Wchris

    Any headers?

    I agree ... for some reason Josh was interrested in the project, and i like to fight for the desperate causes of the little, and also because i don't agree there should be one language to rule them all, one language to find them, one language to compile them all and in the darkness link them , so i did help with it ... but i don't really want to invest myself more alone in the void if a true user does not show up. Delphi & object pascal is a bit different because i'm the user So i think we will have a break and wait until someone comes Thank you Paul for the help, good luck with you'r game project (and good luck to me for my game because eventually i want to write a game too )
  6. Ehh well ... maybe 'all black & white' is a bit sad ? or maybe it's just me ... but it could be appreciated to be able to change colours of the forum in the profile settings with the same skin in red, blue, or green.
  7. Wchris

    Any headers?

    LOL i don't speak purebasic, i mean functions and procedures like they are available in C++ and Pascal. Can you provide me a sample ? lets say we have this C++function function TVec16 GetThingMatrix (TThing athing , int atry) { TVec16 result; leGetThingMatrix(athing, atry, &result); return result; } end; how would you traduce this to purebasic ? PS: i have 4.30 manual
  8. Wchris

    Any headers?

    I have uploaded the new header generator. I did not prefix the constants with LE like Josh suggested because i'm not sure you want it. If Purebasic #KEY_ESCAPE already exists then the value is probably also 27 so we could perhaps just comment it out ? Unlike C++ header and Pascal Header i don't generate "function wrappers" in purebasic because i don't know how to. From what i have read in the manual Purebasic cannot return a structure as the result of a function, so this was a showstopper for me. Anyway, functions are not so interresting (except if you want to traduce easily C++ code that uses them) because procedure performance is better. With a procedure returning 1 result, you can use your variable n times after. But with a function you could be tempted to test n times the result of the function wich is slower. And even if you affect the function to a variable, you are still slower because the function creates a temporary variable to transmit the result while a procedure can do it directly.
  9. Hello Zerobyte, happy to see you again don't forget to try this http://leadwerks.com/werkspace/index.php?app=downloads&showfile=87 it'll show you how to enable Framework and Lua. Have fun !
  10. You mean the editor ? Rick is right this happen when you set a wrong path in the editor, the solution is to edit the editor.ini file manually and set back the right path.
  11. Wchris

    Any headers?

    Hi Paul, i'm back home I'm glad you could compile a working sample. I only have purebasic trial and could not compile the header (too big for trial) Maybe the macros could be added automatically to the header by the header generator ? (if you explain me) Look at the header generator template directory. There you can change the constants names in PureBasicLEUnit.txt that is used for main code structure. you should also add TFramework=.i and TScene=.i in PureBasicTypes.txt template as they are missing. and use PureBasicLEWrappersFix.txt to do différent kind of renaming Just tell me if you want to change something
  12. Wchris

    Any headers?

    Hello Paul, The Delphi/Pascal header generator available in the download section can also generate PureBasic headers. Purebasic is not mentionned in the download because it's an alpha version that never went to beta stage for now. I'm not a Purebasic programmer so there are probably many errors in the generated Purebasic header code, so i need an experienced Purebasic programmer to test further. Maybe you ? if you test you'll have to provide a list of fixes (or a complete fixed header) to show me what to change in the generator. Welcome dear purebasic adventurer PS: remember Purebasic is not officially supported, it's only community support, so if it doesn't work i'm responsible of nothing. Anyway even if the header is not perfect, even if it' only 90% of the job ... 90% is better than nothing, right ? I have to go at work now, i won't be available until this evening
  13. While you are working on the navigation bar, could registered SDK users have links to the wiki and tutorials pages from here ? Thank you
  14. A simple example showing how to use the 2.3 Framework and Lua is available here http://leadwerks.com/werkspace/index.php?app=downloads&showfile=87 OUPS : a duplicate i did not know downloads would also appear here Now i don't know how to delete this post
  15. File Name: WerkSpace Icons File Submitter: Wchris File Submitted: 23 Jan 2010 File Updated: 14 Oct 2011 File Category: Materials Resolution: 128x128 An icon to créate a shortcut to the WerkSpace on your desktop Click here to download this file
  16. Yes but i don't know which download section to choose. Tool & utilities ? ... its not really a tool or an utility
  17. Just a small icon i made and use for a shortcut to werkspace Werkspace.ico
  18. File Name: Delphi/Pascal/Purebasic Header generator File Submitter: Wchris File Submitted: 21 Jan 2010 File Updated: 25 Sep 2010 File Category: Tools and Utilities This tool generates object pascal or purebasic headers from original C++ engine.h header. I just updated and enhanced it, the original version was written by Lupin. Source code included Last update 25 September 2010 Beta support for purebasic in progress, please follow this thread for more information http://leadwerks.com/werkspace/index.php?/topic/2724-purebasic-import-1st-try/page__pid__25457__st__20#entry25457 Click here to download this file
  19. i know 7zip ... but the file is still 469Ko in ultra mode ... so if the 500Ko limit is not per post but per user ... i have 31Ko left for my own usage and anyway with .7z i get "Error You aren't permitted to upload this kind of file" EDIT : Found the solution ! I uploaded the file in the downloads section here http://leadwerks.com/werkspace/index.php?app=downloads&showfile=83 There, i'm not limited in size.
  20. Error This file was too big to upload Hmm ... i'm limited to 500Ko of upload and the header generator zip is 674Ko maybe i could get an extra credit to reach 1174Ko ?
  21. Hi Roland, Here's my little contribution to your project program exemple1; {$ifdef FPC} {$mode delphi} {$endif} {$H+} uses Classes, SysUtils, LeadWerks; var Framework: TFramework = 0; Lua: Pointer; Camera: TCamera; Light: TLight; Material: TMaterial; Mesh: TMesh; Ground: Tmesh; begin RegisterAbstractPath('C:\Program Files\Leadwerks Engine SDK'); SetAppTitle('Exemple1'); try // Set graphics mode if Graphics(1024, 768)=0 then Exception.Create('ERROR: Failed to create set graphics mode.'); // Create framewerk object and set it to a global object so other scripts can access it Framework := CreateFramework; if Framework=0 then Exception.Create('ERROR: Failed to create Framework'); if Framework<>0 then begin // Set Lua variable Lua := GetLuaState; lua_pushobject(Lua, pointer(Framework)); lua_setglobal(Lua, 'fw'); lua_pop(Lua, 1); end; Camera := GetLayerCamera(GetFrameworkLayer(0)); PositionEntity(Camera, Vec3(0, 0, -2)); Light := CreateSpotLight(10); RotateEntity(Light, Vec3(45, 55, 0), 0); PositionEntity(Light, Vec3(5, 5, -5), 0); Material := LoadMaterial('abstract::cobblestones.mat'); Mesh := CreateCube; PaintEntity(Mesh, Material, 0); Ground := CreateCube; ScaleEntity(Ground, Vec3(10, 1, 10)); PositionEntity(Ground, Vec3(0, -2, 0), 0); PaintEntity(Ground, Material, 0); Light := CreateDirectionalLight(0); RotateEntity(Light, Vec3(45, 45, 45), 0); // Activate Framework Postfilter Effects //SetAntialias(1); //SetDistanceFog(1); //SetStats(2); //SetHDR(1); //SetGodRays(1); //SetBloom(1); //SetSSAO(1); while (KeyHit(KEY_ESCAPE)=0) and (AppTerminate=0) do begin TurnEntity(Mesh, Vec3(AppSpeed*0.5, AppSpeed*0.5, AppSpeed*0.5), 0); UpdateFramework; RenderFramework; Flip(0); end; except on E: exception do begin Applog(PAnsiChar(' Exception occured ! '+E.message)); end; end; end. I wonder if there is a difference in FPS between the C++ versions Framewerk/framework ? Good luck too PS: i did not test this with delphi, only lazarus/freepascal
  22. Happy you found out Arbuz problem. If it's just a C++ coding issue than you're far better than me for sure. What will happen with the old C++ framewerk. Totally deprecated or a come back is possible ?
  23. very interresting ... i'll have a closer look at LEO. Thanks EDIT : Hmmm ... when i see this in LEO framework inline void Framework::Update() const { ::leUpdateFramework(); } inline void Framework::Render() const { ::leRenderFramework(); } this makes me think LEO is calling the engine.dll framework methods ... and not the C++ framewerk renderer methods not sure but probable in that case it will work, but the C++ framewerk is not used
  24. you cannot do this. you must choose between full C++ framewerk or engine.dll included framework. Lua expects a handle to the engine.dll framework, the C++ framewerk is not compatible. i know this because i also hit this problem, one solution would be to extract framework from engine.dll and create a framework.dll with defined header ... this way we could create a compatible framework.dll in C++ and lua could call exported methods without knowing it's bmx or C++ compiled code. But i don't think Josh is headed this way now that framework is included in engine.dll. Anyway, if you don't want to modifiy the framework code, solution 2 with the engine.dll integrated framewrok is the easyest solution.
×
×
  • Create New...