Jump to content

Search the Community

Showing results for tags 'c++'.

More search options

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


  • Models
    • Animals
    • Barriers
    • Characters
    • Containers
    • Environments
    • Furniture
    • Props
    • Rocks
    • Vegetation
    • Vehicles
    • Weapons
  • Materials
    • Brick
    • Cartoon
    • Decals
    • Dirt
    • Grass
    • Industrial
    • Medieval
    • Metal
    • Plastic
    • Plaster
    • Rock
    • SciFi
    • Sky
    • Signs
    • Tile
    • Stone
    • Walls
    • Wood
  • Plugins
  • Scripts
    • GUI
    • Object
    • Utilities
  • Shaders
    • Post-Processing Effects
    • Surface
  • Sounds
    • Ambience
    • Effects
    • Music
  • Tools
  • BATTLE LEAGUE's Assets


There are no results to display.

There are no results to display.


  • Leadwerks
    • Technical Assistance
    • General Discussion
    • Programming
    • Game Art
    • Suggestion Box
    • Bug Reports
  • Platforms
    • Windows
    • Linux
    • OSX
  • Community
    • Showcase
    • Promotion
    • Off-topic
  • Arena Shooter's Forum
  • BATTLE LEAGUE's Topics
  • Away from Home's Zone Script
  • Away from Home's General
  • Away from Home's Zone Rigging / Modeling
  • Vec-Tec's Releases
  • Vec-Tec's Topics
  • Forth's Development
  • Forth's Game design
  • Forth's Graphics
  • Forth's Documentation
  • Forth's TODO
  • Forth's IMPORTANT
  • Forth's Screenshots
  • The uncertain world's Game Design
  • The uncertain world's Programming
  • The uncertain world's TODO
  • The uncertain world's Graphics
  • The uncertain world's Screenshots

Product Groups

  • Leadwerks
  • Model Packs
  • Gear

Find results in...

Find results that contain...

Date Created

  • Start


Last Updated

  • Start


Filter by number of...


  • Start





Found 313 results

  1. Hey all, I have started some minor milestone development (Using vanilla C++) in which I have made a simple menu system where upon hitting escape, the mouse appears, and the control stops. I want to have some GUI (maybe a few buttons) appear. Now I don't know much on this topic, but I want people's opinion on it. What is the best gui for Leadwerks? Thanks in advance...
  2. Hey all, After programming for a few years I've noticed that the performance in my projects are low. This is mainly because of bad written code. Since I don't really like to keep that bad habit, I will need a bit of your help and advice. I do know how to code, but the problem is coding for performance. My goal is to improve the performance as much as possible. I've started coding in Game Maker - where you don't really have classes but objects. I haven't really been learning how to program in performance back then (neither coding clean actually, working with classes etc). So basically I *cough* might *cough* have had a bad start. In my project Ravage Online (the online FPS) I've only have 8 classes - I assume this is low for over 6000 lines of code (also building takes long, etc). Are many classes good to have when looking at performance and are they easy to use? Also, I'm currently programming in MVS2008 in C and C++. Are there any handy tools to record the performance/check your code for performance? Or are there any ways to check the performance using the Leadwerks engine? Then we have the big while loop. I used to put like every bit of code in there with barely any functions (I feel your pain). But writing functions all the time also fills up a lot of space before the int main - should I work with some more classes? I also noticed some people are sketching what they want to code - I would like to try this. Is anyone doing this as well? Does anyone have tips and tricks for that? At last: Do you have any tips, tricks and/or tools about coding clean/optimizing performance? I'm thinking about having a good start with a new project but don't want to end it up like Ravage, where the easiest scenes have a low FPS because of the code. You don't have to answer them all of course - I just need some advice with coding. Big thanks in advance! - Ivar / Evayr
  3. I was wondering how someone would go about packing things into password files. If I were to load all map files (models etc) into a packaged file would they still be able to access each other, and would I be able to put scripting in there and still have everything load perfectly? I am just not sure and want some clarification. Thanks in advance.
  4. How would one get Motion Blur working? Is it a shader that works on the whole screen? Or can it be applied to a single object / Material?
  5. void _stdcall EntityCollisionCallback( TEntity entity0, TEntity entity1, byte* position, byte* normal, byte* force, flt speed ) Is the position, normal, force parameters relative to entity0 or entity1?
  6. I started working on this today, got it working, and figured I'd share. I still have more work to do but this is a good start. Could use cleaning up but that's for later. SuperStrict Import "-lpsapi" Const PROCESS_QUERY_INFORMATION:Int = $0400 Const PROCESS_VM_READ:Int = $0010 Const PROCESS_VM_WRITE:Int = $0020 Extern "Win32" Function GetLastError:Int() Function OpenProcess:Int(dwDesiredAccess:Int, bInheritHandle:Int, dwProcessId:Int) Function EnumProcesses(pProcessIds:Byte Ptr, cb:Int, pBytesReturned:Int Ptr)="EnumProcesses@12" Function EnumProcessModules(hProcess:Int, lphModule:Byte Ptr, cb:Int, lpcbNeeded:Int Ptr) Function GetModuleBaseName(hProcess:Int, hModule:Int, lpBaseName:Byte Ptr, nSize:Int) = "GetModuleBaseNameA@16" Function TerminateProcess(hProcess:Int, uExitCode:Int) Function CloseHandle(hObject:Int) Function GetModuleFileName(hModule:Int, lpFileName:Byte Ptr, nSize:Int) Function GetModuleFileNameExA(hProcess:Int, hModule:Int, lpFilename:Byte Ptr, nSize:Int) Function GetProcessImageFileNameA(hProcess:Int, lpImageFileName:Byte Ptr, nSize:Int) EndExtern ' enumerate all processes ' Function EnumerateProcesses:Int[]() Local pProcessIds:Byte Ptr Local cb:Int = 1024 Local bBytesReturned:Int Local processes:Int[] pProcessIds = MemAlloc(cb) If Not EnumProcesses(pProcessIds , cb, Varptr bBytesReturned) MemFree(pProcessIds ) Return Null EndIf processes = New Int[bBytesReturned / 4] MemCopy(Varptr processes[0], pProcessIds, bBytesReturned) MemFree(pProcessIds) Return processes EndFunction ' get process name from process id ' Function GetProcessName:String(id:Int) Local hProcess:Int Local hModule:Int = 0 Local lpBaseName:Byte Ptr[1024] Local nSize:Int = 1024 Local processName:String = "" hProcess = OpenProcess(PROCESS_QUERY_INFORMATION | PROCESS_VM_READ, 0, id) If hProcess = 0 Return "" GetModuleBaseName(hProcess, hModule, Varptr lpBaseName[0], nSize) processName = String.FromCString(lpBaseName) If processName = "?" Or processName = Null GetProcessImageFileNameA(hProcess, Varptr lpBaseName[0], nSize) processName = StripDir(String.FromCString(lpBaseName)) EndIf CloseHandle(hProcess) Return processName EndFunction ' EXAMPLE USEAGE ' Local pList:Int[] = EnumerateProcesses() If pList.length > 0 For Local i:Int = 0 To pList.length - 1 If pList[i] <> 0 Local pname:String = GetProcessName(pList[i]) If pname <> "" Notify(pname) EndIf Next EndIf
  7. I spent all day working on this, rewrote the code a few times, a couple methods weren't reliable enough, and this is basically my last chance (before reverting to the best method so far). I'm using a named pipe from BlitzMax to my DLL. The message is sent but once I send another message it crashes the DLL loaded application (I can't specifically say what that application is, but this application loads/binds the DLL). I need to this to be a continuous evaluation for sent messages only to stop once I manually close the handle. If what I'm doing isn't doing that, please let me know how to fix it. I'm not very good with C++ and I haven't had much practice having BMax use Win32 external functions, although I got this to work on the first try, I brush it up on hair pulling luck. C++/DLL side: void BeginPipe() { _beginthread(BeginPipeThread, 0, NULL); } void BeginPipeThread(void* pParams) { LPTSTR _PIPE_NAME = L"\\\\.\\pipe\\RhysPipe"; char Received_Buffer[256]; DWORD BytesRead = 0; HANDLE hPIPE = CreateNamedPipe(_PIPE_NAME, PIPE_ACCESS_DUPLEX, PIPE_TYPE_MESSAGE | PIPE_READMODE_MESSAGE | PIPE_WAIT, PIPE_UNLIMITED_INSTANCES, 256, 256, 10000, 0x00000000); if(hPIPE != INVALID_HANDLE_VALUE) { int Connected = 0; while(!(GetAsyncKeyState(VK_F8))) { Connected = ConnectNamedPipe(hPIPE, NULL); if(Connected == 1) { BOOL bRead = ReadFile(hPIPE, Received_Buffer, 256, &BytesRead, NULL); if(bRead != 0) { // write message for testing ofstream myfile; myfile.open("WriteTest.txt", ios::app); myfile << Received_Buffer << "\n"; myfile.close(); } } else { CloseHandle(hPIPE); } } } DisconnectNamedPipe(hPIPE); CloseHandle(hPIPE); } I execute "BeginPipe()" as this needs to be on a second thread to not freeze the application waiting for a message. And the BMax side: Const GENERIC_WRITE:Int = $40000000 Const OPEN_EXISTING:Int = 3 Const INVALID_HANDLE_VALUE:Int = -1 Extern "Win32" Function CreateFileA(lpFileName$z, dwDesiredAccess:Int, dwShareMode:Int, lpSecurityAttributes:Byte Ptr, dwCreationDisposition:Int, dwFlagsAndAttributes:Int, hTemplateFile:Int) Function WriteFile(hFile:Int, lpBuffer:Byte Ptr, nNumberOfBytesToWrite:Int, lpNumberOfBytesWritten:Int, lpOverlapped:OVERLAPPED) Function CloseHandle:Int(hObject:Int) Function CreateEventA:Int(lpEventAttributes:Int, bManualReset:Int, bInitialState:Int,lpName$z) EndExtern ' OVERLAPPED ' Type OVERLAPPED Field internal:Int Field internalHeight:Int Field offset:Int Field offsetHeight:Int Field hEvent:Int = CreateEventA(0, 0, 0, Null) Method Delete() If hEvent CloseHandle(hEvent) EndMethod EndType Global hFile:Int = CreateFileA("\\.\pipe\RhysPipe", GENERIC_WRITE, 0, Null, OPEN_EXISTING, 0, Null); Local buffer:Byte Ptr Local bytesWritten:Int Local MyString:String = "THIS IS A TEST FROM BMAX" buffer = MyString.ToCString() If hFile WriteFile(hFile, buffer, 256, bytesWritten, Null) EndIf Again, it works, but when sending a second message, it prints, and then crashes. Not exactly sure why but I'm too novice in C++. Any help would be appreciated.
  8. Does anyone know how to register a new MIME type and create an ActiveX control that calls a local DLL on the user's machine? I am not trying to download and call a DLL, just call an existing one. It should work on IE, FF, and Chrome.
  9. What is the difference between 'debug' and 'release' modes in VS 2008? Is it simply that release mode lacks the macro 'DEBUG' definition? If I remove this macro, am I getting a complete "release" DLL, or is it being slowed down by some other debugging stuff?
  10. I am trying to replace my instances of LoadMesh() in my program with LoadModel() to take advantage of the automatic LOD properties of a model. However, when my character is declared as a Model, the animations no longer work. The model resorts to the T-pose. If the character is declared as a Mesh, then the animations work fine. The Animate() documentation says this: It doesn't seem to be working out for me. I've tried various children of the model for animating and loading the animations.
  11. File Name: Custom control for rendering leadwerks and c++/cli windows forms. File Submitter: Von04 File Submitted: 22 Jan 2012 File Category: Tools This is a custom control which renders leadwerks to custom control using a custom buffer and a c++ window form application. It has been tested on 2008 and 2010 c++ express, 2010 visual studio professional and c# all versions. How to use: 1. Create a windows form application. 2. Add the LEControl.Dll file to your projects release/debug folder, whichever one your running. 3. Add Shaders.Pak, Scripts Folder, Engine.dll, Engine.Cpp, and Engine.h to your project directory. 4. Go to the Form designer and open up the Toolbox. 5. Right-click and select Choose Items. 6. After the Choose Items dialog appears (usually takes awhile) selecte the Browse... button. 7. Navigate to your projects Release/Debug folder and select LEControl.Dll. 8. A new control should now appear called LEControl. Click OK. LEControl should now be added to your toolbox. 9. Drag a LEControl onto your windows form. In the example, I renamed from lecontrol1 to Window. 10. Go to the new controls events (click the lightning bolt icon) and double click the Paint event. 11. The newly created function is now your leadwerks rendering loop. Add your code here that you would normally have inside your main loop. There is no need to add the actual rendering code, because the control sets that up automatically. Just enter code for modifying entites e.g. 12. Go back to the control events and double-click the Resize event. Inside the newly created function add the line: Window->ResizeBuffers(); This is assuming that you renamed your control Window. Otherwise add the line: lecontrol1->ResizeBuffers(); This will resize the custom buffer to match the size of the control. 13. See the Example.Cpp file to see how to #include "Engine.Cpp". 14. In your Form1.h file make sure your add #include "Engine.h" at the top of the file. 15. In the Form1 constructor add: Initialize(); RegisterAbstractPath("Your SDK Location Here"); before the line: InitializeComponent(); 16. After InitializeComponent() add the line: Window->InitializeLeadwerks(true); // Uses framework or Window->IntializeLeadwerks(false); // no framework 17. InitializeLeadwerks sets up leadwerks creating world and cameras for you. See the Form1.h file included with the zip pack for an example for accessing the different camera and worlds. 18. Run your form and that should be it. This control has been tested on c++ 2008 and 2010 express, 2010 Visual Studio Professional, and all years of C#. If you have any suggestions and encounter any bugs please post them here. Enjoy! Click here to download this file
  12. File Name: LEControl for rendering leadwerks on c++ windows forms. File Submitter: Von04 File Submitted: 22 Jan 2012 File Category: Tools This is a custom control for rendering leadwerks to a custom buffer using an opengl control on a c++/cli windows form. There is a sample project created with c++ 2008 express. The control was also tested on c++ 2010 express and professional versions and ran fine. This control has also been tested and works with c# windows forms. The sample project shows the custom control already attached to a form, but if you want to add the control to another form then follow these rules: 1. Add the LEControll.Dll file to your projects release/debug folder. 2. With your form project open, open the ToolBox and right-click. 3. Select Choose Items. 4. When the Choose Items dialog pops up (which usually takes a long time) select the Browse... button. 5. Then go to your projects release/debug folder and select LEControl.Dll. 6. A new control called LEControl should now show up and be checked. Click OK. 7. Now a new control is added to your Toolbox called LEControl. 8. Click and drag a LEControl onto your windows form. 9. Highlight your newly created control and select the event properties ( the little lightning bolt icon). 10. Go to the event called Paint and double click the empty value box. 11. Under the newly created function is your rendering loop. Add all code here that would normally appear in in your loop. Don't worry about adding the code for actual rendering of the world or the framework for the control already has this code built in. 12. Go back to the designer and find the Resize event. Double click. Inside the newly created function add line: lecontrol1->ResizeBuffers(); This is assuming you didn't change the name of the control. lecontrol1 is the default name of the control. 13. Please see the included example project for setting up the main forms constructor. There are some things I'm still working on and will update as needed, but this is definitely a working control. If you encounter any bugs please post them here. Click here to download this file
  13. JoshMK

    C++ Threads

    I am not new to multithread programming, but I have never done it in C++. I want to create a thread to execute a function, and be able to tell when the thread is finished. The code should run on Windows and OSX. If it can run on Android and iOS, that's great, but I don't expect it to. Where can I find a simple example that shows how to do this?
  • Create New...