Jump to content

Purebasic Import - 1st try


smateja
 Share

Recommended Posts

nopes - because the compiler think its an variable without the #

 

by hte way - have you tried the command - LESetSSAO(1) - *G freezes my app ;)

ah, cool ! i declare variables without knowing i do :P

 

ssao ? nope didn't try this lately, was working in 2.32.

 

do you still have a back screen ? ssao shader is perhaps confused by a full black screen :D

 

i'll try

 

can i remove the macros from the header ? they are not needed anymore if i do your LExxx.LExxxl = GetFunction(#Engine_Library, "xxx")

Windows 7 home - 32 bits

Intel Quad Q6600 - nVidia GTX 460 1GB - 2 GB RAM

Link to comment
Share on other sites

you have a purebasic licence too ?

 

Yes, and I sold some programs coded with purebasic. But I bought Blitmax because there were not leadwerks wrapper for purebasic, and other usefull things like OOP.

WINDOWS 10 - UBUNTU 20.04 - [iNTEL i5-3330] [16GB RAM] [NVIDIA GTX 1050ti]

Link to comment
Share on other sites

Ok i think understood, will replace Protected result by Static Result

Thanks (sorry, i'm a bit slow) :)

That too can be a problem, if you don't copy the result the following call to the same function will over write it.

Intel Core i7 975 @ 3.33GHz, 6GB ram, GTX 560 Super OC, Windows 7 Pro 64bit

Link to comment
Share on other sites

That too can be a problem, if you don't copy the result the following call to the same function will over write it.

i don't know how to copy the value, how would you code this ? :huh:

 

copying the value may lead to memory leaks, the copied value will never be freed ? no ? :)

 

 

I have packaged a new header generator version including static variables and smateja modifications, you can redownload and try it.

 

i tryed to use XIncludeFile("Leadwerks.pb")

but when i do this i get and error

[compiler] line 83 Constant not found #Engine_library

 

i don't understand why :blink: any help ?

Windows 7 home - 32 bits

Intel Quad Q6600 - nVidia GTX 460 1GB - 2 GB RAM

Link to comment
Share on other sites

i don't know how to copy the value, how would you code this ? :blink:

Using the CopyStructure command.

 

copying the value may lead to memory leaks, the copied value will never be freed ? no ? :)
Depends what its been copied to, a variable should be ok, but if its an allocation then it needs to be freed.

Intel Core i7 975 @ 3.33GHz, 6GB ram, GTX 560 Super OC, Windows 7 Pro 64bit

Link to comment
Share on other sites

i tryed to use XIncludeFile("Leadwerks.pb")

but when i do this i get and error

[compiler] line 83 Constant not found #Engine_library

 

i don't understand why :blink: any help ?

#Engine_library isn't assigned a number, plus its in a function. I find using #PB_Any is better, which a generates a number instead.

Don't really see the point of "Init_Engine_Enum()" it doesn't do anything and just contains the constants and structs.

 

Macro _leInitialize(le_dll)
le_lib=OpenLibrary(#PB_Any,le_dll)
If le_lib
	_leInitAllFuncs()
Else
	lePrint(le_dll+" can't be loaded.")
EndIf
EndMacro

Intel Core i7 975 @ 3.33GHz, 6GB ram, GTX 560 Super OC, Windows 7 Pro 64bit

Link to comment
Share on other sites

#Engine_library isn't assigned a number, plus its in a function. I find using #PB_Any is better, which a generates a number instead.

Don't really see the point of "Init_Engine_Enum()" it doesn't do anything and just contains the constants and structs.

#Engine_library without a number worked in smateja header and in the simpleFWexample in my post 24. something must be missing now.

 

for the Init_Engine_Enum() usage, i think i'll let smateja answer

 

Depends what its been copied to, a variable should be ok, but if its an allocation then it needs to be freed.

I don't like this, a function like vec3 is used 50 times in a main loop that loops 300 times per second... if you don't free the memory will be full in no time.

 

I think i'll add 1 more parameter to all vecx procedures to return the result. This way the structure will be created outside of the procedure (because you have to provide it) and it solves the problem.

Windows 7 home - 32 bits

Intel Quad Q6600 - nVidia GTX 460 1GB - 2 GB RAM

Link to comment
Share on other sites

#Engine_library isn't assigned a number, plus its in a function

#Engine_library without a number worked in smateja header and in the simpleFWexample in my post 24. something must be missing now.

 

for the Init_Engine_Enum() usage, i think i'll let smateja answer

 

 

 

#Engine_library without a number worked <- SM: because i enumerated it

plus its in a function <- SM: not really? why a function - its only a variable that becomes thru the enumeration an fixed number @ compilation time => konstante

 

.. fu** - i think the google translater works better than my bloody english - *narf*

 

 

I think you have cleand out the code - and so the init_enum procedure will not be called? - so the #Engine_library did not get a number at compilation.

Link to comment
Share on other sites

@Wchris

 

i tested your new version of the headergen.

 

mmh where should i begin - okay - looks very good :blink: - your my hero ;)

2nd - your right - no need for the macros

 

okay - litte problem - you forgot an enumeration at line 83 - befor the #engine_library

and.... no need for the procedures:

 

- LE_Engine_Stop

- LE_Engine_Functions_List

 

they where only for testing for my beginnings of testing the engine with pb - so u can delete line from 1161 to 1179.

 

By the way - the command lines at the beginnig - line 3 to 8 have problems with the spaces at the end

- line 847 - comment helper funtions i think can deleted also

- comment line 835 - 837 - mapping declaration --- mmhm must be move to 1186 - better - delet it :)

 

can u correct the procedure names? it looks like this: LEGetGraphicsVendor ( ) - better without spaces like LEGetGraphicsVendor() -thx

 

greetings

Link to comment
Share on other sites

Hi @ all,

 

i tested some commands - some work some not - maybe someone can test this:

 

works:

 

LESetStats(2)

LESetNearDOF(1)

LESetNearDOFStrength(0.2)

LESetNearDOFRange(0.5, 1)

LESetFarDOF(1)

LESetFarDOFStrength(1)

LESetFarDOFRange(1.5, 5)

LESetGodRays(1)

LESetAntialias(8)

LESetSaturation(1)

LESetBrightness(1)

LESetContrast(1)

LESetBloom(1)

LESetHDR(1)

LESetDistanceFog(1)

LESetZoom(1)

LESetBackgroundMode(0)

 

not working:

 

LESetWater(1)

LESetSSAO(1)

 

not working correctly:

 

LEGetGraphicsVendor() = shows at debut at me 3 (i have an nvidia)

LEGetShaderModel()

LEMaxAFilter() => show with debug at me 1 (i think x>8 will work fine at me)

LEMaxTextureUnits() => shows 0 - no texture units?

LEMaxColorBuffers() => shows 0 - no maxcolor ?

 

 

 

Also i have problems with the LELoadScene command - it loads the scene - i get stats about a lot of polygons - but i only see a black screen?!

 

thanx

Link to comment
Share on other sites

Yes, and I sold some programs coded with purebasic. But I bought Blitmax because there were not leadwerks wrapper for purebasic, and other usefull things like OOP.

 

 

- no need for a wrapper - open the dll and go

- PB can oop - search forums @ purebasic.fr/english for explanings and tutorials

Link to comment
Share on other sites

plus its in a function <- SM: not really? why a function - its only a variable that becomes thru the enumeration an fixed number @ compilation time => konstante

Then there is no reason for a procedure to contain the structures and constants.

Intel Core i7 975 @ 3.33GHz, 6GB ram, GTX 560 Super OC, Windows 7 Pro 64bit

Link to comment
Share on other sites

not working:

 

LESetWater(1)

LESetSSAO(1)

 

Also i have problems with the LELoadScene command - it loads the scene - i get stats about a lot of polygons - but i only see a black screen?!

 

thanx

pb #1: this is probably not a declaration header problem, the declaration for these commands are so simple there is no place left for an error. It is either a new bug introduced in 2.40 (then see with Josh) or more probably a graphics driver issue (what are yours specs and driver version ?).

 

pb #2: ;) how do you know water does not work in pb #1 if you see only a black screen ? you crash ?

The black screen is often a camera position problem, but in your case if you have polygons with setstats(2) then maybe it's a light problem ? :blink: i'm not sure. maybe with a zip file of your project and assets i could see something.

 

Edit : Updated the header generator, please re-download

- changed the enumeration numbers for dll to a fixed value

- removed Procedure Init_Enum() not required like Paul said

- removed static result and added Result parameter to all vec procedures like Paul said

- removed functions list procedure

- did some minor tweaks (can't remember)

 

here is a sample application showing the current use

 

Please rebuild the headers and compile & run this sample project + post a screenshot

 

i did nor remove the helper functions, some people may want them (especially curve, you'll need this believe me), anyway it's easy to comment them out after header generation if you don't want them.

 

 

for the LE api function that are not working, i think you must call Josh to help, but way until you got a working screenshot.

Windows 7 home - 32 bits

Intel Quad Q6600 - nVidia GTX 460 1GB - 2 GB RAM

Link to comment
Share on other sites

You right - it´s only for me to hide this in the code - no need for the procedure

He he, Paul is also good in purebasic :D his help is precious. :)

 

did you try my latest simpleFWexample from post #40 ? do you see a rotating cube ? can you make a screenshot ? Thanks

Windows 7 home - 32 bits

Intel Quad Q6600 - nVidia GTX 460 1GB - 2 GB RAM

Link to comment
Share on other sites

  • 2 weeks later...

He he, Paul is also good in purebasic ;) his help is precious. :)

 

did you try my latest simpleFWexample from post #40 ? do you see a rotating cube ? can you make a screenshot ? Thanks

 

Sorry - i went for a few days in holiday - so now i am back again.

Tomorrow i test all and report back to you - when i remember correctly befor my holiday - your example works fine - i test it again and tomorrow i will report you back.

 

so on....

Link to comment
Share on other sites

Sorry - i went for a few days in holiday - so now i am back again.

Tomorrow i test all and report back to you - when i remember correctly befor my holiday - your example works fine - i test it again and tomorrow i will report you back.

 

so on....

Cool :) where were you ? Did you have sun ?

 

Now you'r back with plenty of energy to write the first Purebasic LE game ! ;)

 

What kind of game will it be ? do you already have an idea ?

Windows 7 home - 32 bits

Intel Quad Q6600 - nVidia GTX 460 1GB - 2 GB RAM

Link to comment
Share on other sites

Cool :) where were you ? Did you have sun ?

 

Now you'r back with plenty of energy to write the first Purebasic LE game ! ;)

 

What kind of game will it be ? do you already have an idea ?

 

Hi Wchris,

 

yes - there was a lot of sun - and i got some burnings on my skin ;)

 

I tried the actual headgen - there is a little problem with the Procedure LE_Engine_Stop(). The Command LEEndRender() Could not be found - i check later why.

 

Second - i check your SimpleFWExample - works fine.

Is it possible that you can give a pb example that loads a map that comes with the LE sdk - or makes an example wirh water - both don´t work at this time for me.

 

I have no plans yet for a game - more for an application leadwerks + pb + sql. A kind of Sandbox Editor with multiuser - later maybe a game. People can upload models textures sounds etc. and use them to make a kind of virtuall city or an architactual marketplace.

 

At the moment i experementing with the engine. The sql code is ready - server with 100 mbit direct connect is ready - now i must get firm with the engine.

 

If you like my project - your a welcome to help - i buy you a pb version :)

 

so on....

Link to comment
Share on other sites

I tried the actual headgen - there is a little problem with the Procedure LE_Engine_Stop(). The Command LEEndRender() Could not be found - i check later why.

This is easy, i'll just modify the PureBasicLEUnit.txt template and move LE_Engine_Start() and LE_Engine_Stop() after <%%WRAPPERSCODE%%> because LEEndRender.LEEndRender = GetFunction(#Engine_Library, "EndRender") should be declared before the function is called.

Second - i check your SimpleFWExample - works fine.

Is it possible that you can give a pb example that loads a map that comes with the LE sdk - or makes an example wirh water - both don´t work at this time for me.

Ok i'll do that with desert_highway, but you'll have to add the water yourself in the editor because there is no water by default on the maps that come with the sdk.

A kind of Sandbox Editor with multiuser At the moment i experementing with the engine. The sql code is ready - server with 100 mbit direct connect is ready

Why not, you'll have the first MMPORG 3D EDITOR then :lol:;)

Could be great for building a community project.

If you like my project - your a welcome to help - i buy you a pb version :)

You're generous, but it still fighting to find time for my own game (i have a new house with plenty of work to do outside, and my wife thinks time spent in front of my computer is wasted) so i would only slow you down.

Windows 7 home - 32 bits

Intel Quad Q6600 - nVidia GTX 460 1GB - 2 GB RAM

Link to comment
Share on other sites

hehe - womans can break the creative phase :)

 

@wchris - can u give me an working example code for pb for loading a scene - i tried now many times - but - i don´t see anything - maybe problems again with the cameralayer.

 

ok here's your sample LoadsceneExample.zip

 

unzip to a folder and copy engine.dll, shaders.pak, scripts folder, materials folder, models folder from your sdk to this new folder. (this is probably what you forgot)

 

Please don't ask me for more tutorials, i have not enought time to become a teacher, i prefer to specialize only in the header generator support rather that leadwerks support. :)

This problem is not related to the header generator and is not specific to purebasic. Other people like Aggor or Macklebee have specialized in providing tutorials, you should read their tutorials because i do too and their work is great. Josh also made tutorials and it's not so difficult to translate them to purebasic, but i won't do it, sorry. Thanks for understanding.

 

post-44-021110500 1285010973_thumb.jpg

Windows 7 home - 32 bits

Intel Quad Q6600 - nVidia GTX 460 1GB - 2 GB RAM

Link to comment
Share on other sites

He he, Paul is also good in purebasic :P his help is precious. :blink:

But I still wouldn't use it for something like LeadWerks. Some of the way PureBasic handles things is a real pain.

Intel Core i7 975 @ 3.33GHz, 6GB ram, GTX 560 Super OC, Windows 7 Pro 64bit

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...