Jump to content

enablerbr

Members
  • Posts

    36
  • Joined

  • Last visited

Posts posted by enablerbr

  1. tjheldna I just downloaded from the email I was sent. Windows zip file was named "LeadwerksUpdater3.1.win32.zip". The updater installed just fine with an exe file in the correct folder.

     

    Oh looking at the screenshot for the folder. You're also missing dll's which should also be there.

  2. if i call Graphics() again won't it just start a new window?

     

    scratch that. i just did a test and it does just start a fresh window and without the Maximize button.

     

    this has just made me realise that without the LE ability to natively resize a graphics window. everytime a user decides they need to change resolution. the app has to be restarted from fresh. which i guess is the same for changing from a window state to a fullscreen state.

  3.            hWnd = WindowsAPI.FindWindow("DFTester.exe", null);
               WindowsAPI.SetWindowLong(hWnd, WindowsAPI.GWL_STYLE, WindowsAPI.GetWindowLong(hWnd, WindowsAPI.GWL_STYLE) | WindowsAPI.WS_MAXIMIZEBOX);
    
    

     

    as i don't understand the use of FindWindow. is that the way it shoud be used? or should "DFTester.exe" be replaced with something else?

    also would i put this before Graphics() or after it?

  4. pity no more stanard edition. i won't have the funds any time soon to buy the £500 professional upgrade version. so i'll just stick with 2008 and use the c# 2010 express version. i do think the new IDE can be slow to respond to updating references at times. so i get errors underlined that are not errors at all.

  5. i think the only way to do what you want is to create an OpenGL context of your own and use CreateCustomBuffer command instead of the Graphics command. that would mean you would use the OpenGL swapbuffers instead of Leadwerks graphics Flip command. This way your responible for the backbuffer, which will be the custombuffer you create.

    • Upvote 1
  6. Hello

     

    I just emailed you, to rectify the situation.

     

    Occasionally there is a hiccup in the discount code system on my site, where so many people experience no problem, where others got the problem you did. All the other purchases from this promotion have gone through ok, except for you and another user.

     

    Best

     

    Steve

     

    Thanks for the quick response. This week just happens to be a bill paying week. So this spare of the moment purchase was a little treat for myself. :P

     

    just thought i would mention i got the difference refunded right away.

  7. new Headers with source are available:

     

    Leadwerks C# Headers

     

    next on todo: fixing Vehicles

     

    i tried compiling with OpenTK 1.0 release and VS 2010 c# express release. the form example/control complain about unresolved referances with OpenTK. oh and i'm using LE 2.31 not the 2.32 beta version.

     

     

    ok got the unresolved sorted out. the form example will run for me in VS 2010 c# express but won't run if i use Leadwerks_Forms_Test.exe outside of VS.

  8. just thought i'd mention that on the NeHe site there is a C# Base Code file. which gives an idea on how to create your own OpenGL user control. it covers a very basic OpenGL version but you could mod it to fit the current spec version.

     

    klepto2 very nice work.

     

    Ubu thanks for releasing your source code. it helped me work out how to do properties with leadwerks dll. though i noticed you didn't implement IDisposable.

  9. Thareh from what i've been doing with render-to-texture. i haven't created a buffer to match the size of the texture. leadwerks simply grabs the contents of my render-to-texture buffer and automatically resizes it to fit on the texture i've created. hence my rtt buffer is set at 1920x1200 and my rtt texture is 128x128. no idea if that helps you.

     

    as for transparent buffer question no idea. i'm still messing around and learning about buffers.

  10. i'm trying to work out render-to-texture. yet i can't work out how to bind a texture to a buffer. also can i bind a camera to a buffer?

     

     

     

    Edit: ok i worked out how to bind buffer to texture. yet the result has the buffer image as being upside down. how do i fix this? do i have to flip the image within a shader. as i see no texture commands for flipping. this is my current code (now includes render-to-texture placed in material).

     

               int width = 800;int height = 600;
    
               Graphic.Graphics(width, height, 0, 0, GraphicModes.GraphicsBackBuffer | GraphicModes.GraphicsDepthBuffer);
               Worlds wld = new Worlds();
               wld.CreateWorld();
    
               Cameras cam1 = new Cameras();
               cam1.CreateCamera(IntPtr.Zero);
               cam1.CameraZoom(Helper.FPSCameraFOV(60));
               cam1.MoveEntity(new Vector3(0f, 2.5f, -6f), 0);
               cam1.EntityHide();
    
               SpotLight spot1 = new SpotLight();
               spot1.CreateSpotLight(12.5f, IntPtr.Zero);
               spot1.LightConeAngles(3f, 13f);
               spot1.EntityColor(new Color4(0f, 0f, 2f,0f), Mode.Disabled);
               spot1.PositionEntity(new Vector3(0f, 10f, -2.5f), 0);
               spot1.RotateEntity(new Vector3(90f, 0f, 0f), 0);
               spot1.SetShadowSoftness(0.5f);
               spot1.SetShadowMapSize(1024);
    
               Cameras cam2 = new Cameras();
               cam2.CreateCamera(IntPtr.Zero);
               cam2.CameraZoom(Helper.FPSCameraFOV(60));
               cam2.MoveEntity(new Vector3(0f, 2.5f, 6f), 0);
               cam2.RotateEntity(new Vector3(180f, 0f, 180f), 0);
               cam2.EntityHide();
    
               SpotLight spot2 = new SpotLight();
               spot2.CreateSpotLight(12.5f, IntPtr.Zero);
               spot2.LightConeAngles(3f, 13f);
               spot2.EntityColor(new Color4(2f,0f,0f,0f),Mode.Disabled);
               spot2.PositionEntity(new Vector3(0f, 10f, 2.5f), 0);
               spot2.RotateEntity(new Vector3(90f, 0f, 0f), 0);
               spot2.SetShadowSoftness(0.5f);
               spot2.SetShadowMapSize(1024);
    
               Cube cube1 = new Cube();
               cube1.CreateCube(IntPtr.Zero);
               cube1.UpdateMesh();
               cube1.PositionEntity(new Vector3(0f, 2.5f, 2.5f), 0);
               cube1.EntityOcclusionMode(OcclusionMode.Hardware, Mode.Disabled);
    
               Cube ground = new Cube();
               ground.CreateCube(IntPtr.Zero);
               ground.ScaleEntity(new Vector3(10f, 1f, 5f));
               ground.UpdateMesh();
               ground.PositionEntity(new Vector3(0f, 0f, 2.5f), 0);
               ground.EntityOcclusionMode(OcclusionMode.Hardware, Mode.Disabled);
    
               Cube ground2 = new Cube();
               ground2.CreateCube(IntPtr.Zero);
               ground2.ScaleEntity(new Vector3(10f, 1f, 5f));
               ground2.UpdateMesh();
               ground2.PositionEntity(new Vector3(0f, 0f, -2.5f), 0);
               ground2.EntityOcclusionMode(OcclusionMode.Hardware, Mode.Disabled);
    
               Cube pictureframe = new Cube();
               pictureframe.CreateCube(IntPtr.Zero);
               pictureframe.ScaleEntity(new Vector3(1.5f, 1.5f, 0.01f));
               pictureframe.UpdateMesh();
               pictureframe.PositionEntity(new Vector3(0f, 2.5f, -2.5f), 0);
               pictureframe.EntityOcclusionMode(OcclusionMode.Hardware, Mode.Disabled);
    
               Cube wall = new Cube();
               wall.CreateCube(IntPtr.Zero);
               wall.ScaleEntity(new Vector3(5f, 5f, 1f));
               wall.UpdateMesh();
               wall.PositionEntity(new Vector3(0f, 2.5f, 0f), 0);
               wall.EntityOcclusionMode(OcclusionMode.Hardware, Mode.Disabled);
               Lights.SetShadowQuality(ShadowQuality.High);
    
               Buffers gbuffer = new Buffers();
               gbuffer.CreateBuffer(Graphic.GetGraphicsWidth(), Graphic.GetGraphicsHeight(), BufferModes.BufferColor | BufferModes.BufferDepth | BufferModes.BufferNormal);
    
               Buffers rttbuffer = new Buffers();
               rttbuffer.CreateBuffer(Graphic.GetGraphicsWidth(), Graphic.GetGraphicsHeight(), BufferModes.BufferColor | BufferModes.BufferDepth | BufferModes.BufferNormal);
    
               Textures rttexture = new Textures();
               rttexture.CreateTexture(128, 128, TextureFormats.TextureFloat);
               rttexture.Texture = rttbuffer.GetColorBuffer(0);
    
               Materials wallmat = new Materials();
               wallmat.LoadMaterial("Materials/RTTMat/RTTMat.mat");
               wallmat.SetMaterialTexture(rttexture.Texture, 0);
    
               Surfaces.PaintSurface(Surfaces.GetSurface(pictureframe.Mesh,1),wallmat.Material);
    
               while (!Convert.ToBoolean(Input.KeyHit(KeyboardKey.KeyEscape)) & !Convert.ToBoolean(Miscellaneous.AppTerminate()))
               {
                   cube1.TurnEntity(new Vector3(0.5f, 0.5f, 0.5f), 0);
                   pictureframe.TurnEntity(new Vector3(0.2f, 0f, 0f), 0);
                   Timing.UpdateAppTime();
                   Worlds.UpdateWorld(0f);
    
                   // Grabs render-to-texture from camera cam2
    
                   cam2.EntityShow();
    
                   Buffers.SetBuffer(gbuffer.Buffer);
    
                   Worlds.RenderWorld(Elements.EntityAll);
    
                   Buffers.SetBuffer(Buffers.BackBuffer());
    
                   Lights.RenderLights(gbuffer.Buffer);
    
                   rttbuffer.CopySourceToBuffer(Buffers.BackBuffer(), Components.BufferColor | Components.BufferDepth | Components.BufferNormal);
    
                   // Hides camera cam 2 and shows camera cam1
    
                   cam2.EntityHide();
                   cam1.EntityShow();
    
                   Buffers.SetBuffer(gbuffer.Buffer);
    
                   Worlds.RenderWorld(Elements.EntityAll);
    
                   Buffers.SetBuffer(Buffers.BackBuffer());
    
                   Lights.RenderLights(gbuffer.Buffer);
    
                   // Draws render-to-texture to screen
    
                   Draw.DrawImage(rttexture.Texture, 40, 40, 40 + 128, 40 + 128);
    
                   Draw.DrawText(Convert.ToString(Timing.UPS()), Graphic.GetGraphicsWidth()-60, 40);
    
                   Graphic.Flip(SyncMode.Disable);
               }
    

     

    ok i just realised my mistake. cam2 shouldn't of had the z axis rotated. oops sorry.

  11. ahh. i see what you mean. as for TextHeight i must have been tired when typing it. as there is no TextHeight in the header just FontHeight. i even made up the code for it aswell. ;)

    though i have to say things are made a little harder as the wiki site isn't keeping upto date with the changes.

  12. while trying to update my c# wrapper. i noticed 3 functions listed in the engine.h file which are not in the engine.dll. these 3 functions are not commented out.

     

    TextHeight

    UpdateTerrainNormal

    UpdateTerrainAlphaMap

     

     

    are they simply gone for good or should they still be there in the engine.dll?

×
×
  • Create New...