Jump to content

aiaf

Members
  • Posts

    720
  • Joined

  • Last visited

Everything posted by aiaf

  1. Want to share this, for people needing sounds. Its a graphical programing environment for creating sound effects. It also has a library that can be linked and used from your program. Only downside i see is might take some time to learn lots of documentation. https://puredata.info/downloads/pure-data
  2. Funny enough i have the same problem I switched to beta branch to try the new ui. /usr/bin/ld: i386 architecture of input file `Source/Libs/Leadwerks/Library/Linux/Debug/Leadwerks.a(Address.o)' is incompatible with i386:x86-64 output
  3. Yeah missing dependencies in your project. You can have a look at this also: http://www.leadwerks.com/werkspace/topic/14990-c-example-project-with-cmake/ In CMakeLists.txt windows section you can find a list of include directories,libraries to link,compiler flags. Warning thats not the whole list just what i needed. Simplest way to me seems to just copy the Leadwerk generated project to other directory. Open the new project in visual studio and rename it. And just use that after.
  4. This is a suggestion to add a c++ official simple example application that uses cmake as build system. Will help people getting started with Leadwerks faster. Bonus you can use the cmake generators and generate the project for whatever ide you like, or build by command line cmake --build . I attached an archive with such a project , works on windows/linux with leadwerks 4.1. Or we could add this to the wiki, that would be acceptable too. lep.zip
  5. This happend to me a while back with an ubuntu update. Check this blog entry for my fix: http://www.leadwerks.com/werkspace/blog/175/entry-1574-leadwerks-and-gcc-521-regarding-c-abi/
  6. aiaf

    lights help

    I increased the light colors to around 3.0 and set the material color for the ground very small. (like 0.004). It looks good and pretty close to what i was aiming. Thanks for help guys
  7. aiaf

    lights help

    Heres a better screenshot showing the light circles at the left of the cube.
  8. aiaf

    lights help

    Yeah your right i was under the impression Diffuse and Specular colors on the material affects the lighting. light->SetColor(1.3,1.3,1.3); world->SetAmbientLight(0.9,0.9,0.9); With above settings lighting looks great, no artefacts on the plane. But im after a darker feel for this game so its not good. It seems this artifacts appear when there is little light in the scene. With this settings the circles pattern appear pretty clear light->SetColor(0.2,0.2,0.2) world->SetAmbientLight(0.9,0.9,0.9) cassius can you reproduce this on your machine ? I mean its just me having this kind of problem
  9. aiaf

    lights help

    I have read this tutorial: http://www.leadwerks.com/werkspace/page/tutorials/_/materials-r7 I have some results, if i generate a material from a texture and put it on the plane it looks great. But for non textured materials no luck i loaded just a color material and the lighting is still bad. Also tried something like this: land->SetColor(0.15,0.15,0.15, 1.0, Color::Specular); land->SetColor(0.15,0.15,0.15, 1.0, Color::Diffuse); land->SetIntensity(1.5, Color::Diffuse); Seems that im not setting everything that is needed from code. Im off to analyze the material file to see why the textured material works well with the ligthing. Thanks guys for pointing to the right direction
  10. aiaf

    lights help

    I try with setting the postion, its the same effect. cassius you say i should add the lights in a map file and then load it ? The game graphics are created by code so i didnt use the editor so far. Is there any difference(regarding lighting) if i use an editor map or write the code myself ?
  11. aiaf

    lights help

    Hello Have some problems with the lighting i setup below: Light* light = DirectionalLight::Create(); light->SetRotation(45,45,0); light->SetColor(0.3,0.3,0.4); world->SetAmbientLight(0.5,0.5,0.6); land = Model::Box(15, 0.0, 15); land->SetPosition(0, -0.55, 0); land->SetColor(0.15,0.15,0.15); land->SetPickMode(0); world->SetWaterMode(true); world->SetWaterColor(0.1, 0.1, 0.15, 1.0); world->SetWaterHeight(-0.55); The lighting looks really bad on the land box, i put some arrows on the screenshot to pin point the problem. That circular grey shape is the lighting and it doesnt look good even in max resolutions. Any ideea what am i doing wrong ? or how to improve this
  12. aiaf

    js to lua

    I suggest you start with the lua tutorials from this site and after the Lua reference manual. Here you go http://www.lua.org/docs.html Take a few days for this or how long you need to be confident with your lua knowledge. After doing this you should be able to convert this js by yourself if you still need it.
  13. Dont know what to say. -rwxrwxr-x 1 alex alex 81052266 Oct 10 23:01 Leadwerks.a Lets see a ls -la on you static lib, last try im running out of ideeas. Also can try to delete Leadwerks from steam and unsubscribe from beta if you have and install again.
  14. What linux distribution are you using? what architecture is it What version of gcc you have ? (post gcc -v output) ld expects the static libs to be of the same architecture. I think you are trying to build a 32bit binary and link in the Leadwerks static libs which are 64 bit. Or you have a 32bit gcc (which is hard to beleive this days). Can try to run objdump -a on the libLeadwerks.a ( will print the architecture of the static lib ) but im sure that is elf64-x86-64. Need more information on your environment to be shure.
  15. You can setup a good logging system for your project. And ignore the debugger just put well thught out prints on the problem areea. This works pretty good
  16. aiaf

    using a timer

    Hello, Im trying to execute some code(in App Loop()) that updates my game objects every 5 seconds. I tried implementing a timer using functions from Time api, but i wasnt very succesfull. If someone have some code like this that works ill be happy to see. So i went on and used Leadwerks thread: Mutex *mutex = NULL; long Updater::tick = 0; Object* UpdateTick(Object* object) { while(1) { mutex->Lock(); Updater::tick++; System::Print("tick: " + String(Updater::tick)); mutex->Unlock(); Leadwerks::Time::Delay(5000); } return NULL; } Updater::Updater(std::vector<Unit *> *units) { this->units = units; mutex = Mutex::Create(); thread = Thread::Create(UpdateTick); } Is it possible to pass an custom object to the Thread EntryPoint ? static Thread* Create(Object* EntryPoint(Object* o), Object* o=NULL) Something like Thread::Create(UpdateTick, myObjectHere). I think im missing something, maybe is another way of dooing this. Thanks
  17. Just backup your project to another folder when in good state. Or git/svn, there are integrated in windows on right click menu: https://tortoisegit.org/ http://tortoisesvn.net/ Learning a version control system if good for you anyway, script kiddie will probably become programmer one day
  18. Hello Wanted to replace the mouse cursor with something else, so i draw a * character. When i look around with the camera the * character it wobbles around, leaving some drawing marks. I need the crosshair to stay put at the center of screen and move smoothly, any ideea how to solve this ? if(!console->isMainMenuMode()) { context->SetBlendMode(Blend::Alpha); context->DrawText("*", player->currentMousePosition.x, player->currentMousePosition.y); context->SetBlendMode(Blend::Solid); } Camera is setup as below: camera->Move(camMovement); currentMousePosition = window->GetMousePosition(); mouseDifference.x = currentMousePosition.x - centerMouse.x; mouseDifference.y = currentMousePosition.y - centerMouse.y; camRotation.x += mouseDifference.y / mouseSensitivity; camRotation.y += mouseDifference.x / mouseSensitivity; camera->SetRotation(camRotation); window->SetMousePosition(centerMouse.x, centerMouse.y)
  19. Hello, I wanted to build my project on windows also, so i installed the latest visual studio community 2015 ( i think is visual studio version 14). It compiles just fine but at the linking stage i got this kind of erros: 2>Leadwerks.lib(Leadwerks.obj) : error LNK2038: mismatch detected for '_MSC_VER': value '1800' doesn't match value '1900' in main.obj 2>Leadwerks.lib(String.obj) : error LNK2038: mismatch detected for '_MSC_VER': value '1800' doesn't match value '1900' in main.obj 2>Leadwerks.lib(FileSystem.obj) : error LNK2038: mismatch detected for '_MSC_VER': value '1800' doesn't match value '1900' in main.obj Seems to not be compatible with the static lib from Leadwerks. Any way to fix this ? besides me installing some older version of visual studio Maybe a static lib version built for visual studio 14 Thanks
  20. I just updated my laptop to ubuntu 15.10 (from 15.04). And got into some intereasting issues. I rebuild my game with the new compiler, and it doesnt link anymore. I got a bunch of undefined references like below: undefined reference to `Leadwerks::Window::Create(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, int, int, int, int, int)' This didnt make any sense, the program was linking just fine with the previous version of gcc (4.9.2). After some digging i found the explanation: https://gcc.gnu.org/onlinedocs/libstdc++/manual/using_dual_abi.html It seems in gcc 5.1 a new abi was introduced, and the Leadwerks static lib was built with some previous version causing the above problems. The solution i used was to add this macro at the begining of every cpp file in the project (in case of linux) #define _GLIBCXX_USE_CXX11_ABI 0 Ths forces the use of the old abi and the game links just fine. I suppose this wont be really a problem for Leadwerks, but was annoying to me. Regards
  21. Just started with Leadwerks.Heres a way to build a c++ project using cmake on linux. Start from an existing project (lets call it Proj): Copy ~/.steam/steamapps/common/Leadwerks into Source/Libs. Now you have Proj/Source/Libs/Leadwerks (this directory contains all the header files and static libs needed). Can use this Libs dir to add any other external libs you need. Here is the CMakeLists.txt: https://github.com/aiafrasinei/lep.git Copy to the root of the project. cmake . and make Will work on windows also with some modifications. ~/Documents/Leadwerks/Projects/test/Projects/Linux/Proj check the codeblocks project (Proj.cbp, Proj.depend) if you need to add more to the CMakeLists.txt Hope this helps
  22. Just started with Leadwerks.Heres a way to build a project with cmake on linux. Start from an existing project (lets call it Proj): Copy ~/.steam/steamapps/common/Leadwerks into Source/Libs. Now you have Proj/Source/Libs/Leadwerks (this directory contains all the header files and static libs needed). Can use this Libs dir to add any other external libs you need. Here is the CMakeLists.txt: CMakeLists.txt Copy to the root of the project. cmake . and make Will work on windows also with some modifications. ~/Documents/Leadwerks/Projects/test/Projects/Linux/Proj check the codeblocks project (Proj.cbp, Proj.depend) if you need to add more to the CMakeLists.txt. Hope this helps.
  23. Start from an existing project (lets call it Proj): Copy ~/.steam/steamapps/common/Leadwerks into Source/Libs. Now you have Proj/Source/Libs/Leadwerks (this directory contains all the header files and static libs needed). Can use this Libs dir to add any other external libs you need. Here is the CMakeLists.txt: CMakeLists.txt Copy to the root of the project. cmake . and make Will work on windows also with some modifications. ~/Documents/Leadwerks/Projects/test/Projects/Linux/Proj check the codeblocks project (Proj.cbp, Proj.depend) if you need to add more to the CMakeLists.txt Hope this helps.
×
×
  • Create New...