Jump to content

Paul

Members
  • Posts

    83
  • Joined

  • Last visited

Posts posted by Paul

  1. Interresting. Do you have a little sample of code for this ?

    What do you mean? On the PureBasic forums one of the developers stated returning the address of a local variable is a bad idea. The C++ code returns the structure by value, thereby copying the struct; PureBasic can't do this, atleast not automatically.
  2. The biggest clue is to avoid LoadScene. Really, all that does is load an entity scene "container", and then models in the scene are loaded as children. But you could just load the entities one at a time with a for-loop since the sbx file is just plain text, it's easy read it manually.

    How would you set up the vegetation layers?
  3. This is what happens with LEO also, because its so huge, so a LEO.DLL would help also here.

    The benefit of static linking is not all the code needs to be included in the exe, a leo.dll would be very pointless.
  4. LE has been always object oriented (internally: yes, DLL: no, wrappers(C++,C#,Delphi,Object Pascal,Lua,etc...): yes), but the limitation was that BlitzMax can only generate procedural DLLs. In LE3 this limitation won't exist anymore, so it's possible to have an OOP DLL (and even a static lib) in addition to the procedural DLL for non-OOP languages.

    I don't think that would work on all c++ compilers because of different ABIs
  5. I put this together, the GUI was generated with LogicGUI and afew lines for the canvas rendering from the OpenSandbox project on the old forums.

     

    SuperStrict
    
    Framework leadwerks.ENGINE
    Import koriolis.bufferedstream
    Import koriolis.zipstream
    Import leadwerks.logstream
    Import leadwerks.audio
    Import leadwerks.ENGINE
    Import leadwerks.glewex
    Import maxgui.maxgui
    Import leadwerks.abstractstream
    Import maxgui.win32maxguiex
    Import maxgui.drivers
    Import brl.event
    Import brl.eventqueue
    
    Local world:TWorld
    Global gbuffer:TBuffer
    Local camera:TCamera
    Local mesh:TMesh
    Global light:TLight
    Local ground:TMesh
    Local material:TMaterial
    
    GCSetMode(2)
    
    SetGraphicsDriver GLGraphicsDriver(), GRAPHICS_BACKBUFFER | GRAPHICS_DEPTHBUFFER
    
    RegisterAbstractPath( "D:/Program Files (x86)/Leadwerks Engine SDK" ) 
    
    Local Window1:TGadget = CreateWindow("Window1",383,112,1042,767,Null,WINDOW_TITLEBAR|WINDOW_RESIZABLE |WINDOW_CLIENTCOORDS )
    Local Canvas1:TGadget = CreateCanvas(0,0,1042,767,Window1,Null)
    	ActivateGadget( Canvas1 )
    	SetGadgetLayout( Canvas1,EDGE_ALIGNED,EDGE_ALIGNED,EDGE_ALIGNED,EDGE_ALIGNED )
    
    	SetGraphics CanvasGraphics(Canvas1)
    
    world=CreateWorld()
    If Not world RuntimeError "Failed to create world."
    
    gbuffer=CreateBuffer(GraphicsWidth(),GraphicsHeight(),BUFFER_DEPTH|BUFFER_COLOR0|BUFFER_COLOR1|BUFFER_COLOR2)
    
    camera=CreateCamera()
    PositionEntity camera,[0.0,0.0,-2.0]
    
    material=LoadMaterial("abstract::cobblestones.mat")
    
    mesh=CreateCube()
    PaintEntity mesh,material
    
    ground=CreateCube()
    ScaleEntity ground,[10.0,1.0,10.0]
    PositionEntity ground,[0.0,-2.0,0.0]
    PaintEntity ground,material
    
    light=CreateDirectionalLight()
    
    RotateEntity light,[45.0,45.0,45.0]
    
    
    Repeat
    PollEvent()
    Select EventID()
    	Case EVENT_WINDOWCLOSE
    		Select EventSource()
    			Case Window1	Window1_WC( Window1 )
    		End Select
    
    End Select
    
    TurnEntity mesh,[AppSpeed()*0.5,AppSpeed()*0.5,AppSpeed()*0.5]
    
    If KeyHit(KEY_ESCAPE) Exit
    If AppTerminate() Exit
    
    UpdateAppTime()
    UpdateWorld(AppSpeed())
    
    SetBuffer(gbuffer)
    RenderWorld()
    SetBuffer(BackBuffer())
    RenderLights(gbuffer)
    
    Flip(0)
    
    Forever
    
    Function Window1_WC( Window:TGadget )
    gbuffer=Null
    FreeEntity light
    GCCollect()
    End
    End Function
    
    

  6. For a dynamic or realtime sky, with day-night, moving clouds, stars, etc what would work better a skydome or skybox?

    For example I was thinking of using a separate dome each for the day and night, and fade/rotate the day skydome to get the effect of stars becoming visible. However from what I can tell the framewerk and editor only appears to support a skybox, so I'm asking before I start implementing a skydome.

  7. How should I be calling it?

     

    This shows what I'm talking about.

    #include "leo.h"
    using namespace LEO ;
    
    int WINAPI WinMain( HINSTANCE hInstance,
    				HINSTANCE hPrevInstance,
    				LPSTR lpCmdLine,
    				int nShowCmd ) 
    {
    Engine engine( "Game", 800, 600 ) ;
    Engine::SetAbstractPath( "E:/Program Files (x86)/Leadwerks Engine SDK" ) ;
    Engine::SetFilters() ;
    Engine::SetShadowQuality(DEEPSHADOW);
    
    World world( CREATENOW ) ;
    if( !world.IsValid() ) 
    {
    	MessageBoxA(0,"Error","Failed to create world.",MB_OK);
    	return engine.Free() ;
    }
    
    Framework fw;
    fw.Create();
    fw.Free();
    
    // Done
    return engine.Free() ;
    }

  8. In the way the script is written, no the sound key in the ini file is not being used. It could have been if the object keys had been set for it inside the script. But if you open the properties dialog for the oildrum, you will see that the mass is being set by the ini file.

    So is this automatic or does the script have to open the ini file?

    I can't find anything in the wiki about how the engine treats ini files.

×
×
  • Create New...