Closed cubedtear closed 8 years ago
Hi aritzhack, firstly thanks for all the work you're putting into this. Using CMake is a good idea, and feel free to let that generate a VS solution as well. I will still be checking in the VS solution / project files though, since that is the primary development environment for Sparky.
Don't worry about CLI, since that's really only intended for tools (such as the Level Editor, which will be Windows only), so we don't need that for Linux. If Linux tools were to exist, they would be written in C++ anyways. The point is, CLI will never be required for the engine runtime.
I would recommend frequently merging master into your branch as you work on this, to reduce the difficulty of merging all of this when you're done. As for coding conventions, there aren't any official docs on that (yet), so my advice would be to just look at the existing code in Sparky, and try and blend in. I think I've demonstrated pretty much every convention that I use, so just follow those.
As for your questions:
sp/platform/directx/DXShader.h
doesn't get included for Linux, and that the switch statements that check the RenderAPI::DIRECT3D
case don't get compiled. My recommendation for that would be to use the SP_PLATFORM_WINDOWS
macro. since (at least for now), only Windows will be using Direct3D.m_UniformData
member doesn't actually exist, that code must be left over from the first iteration of the Material
and MaterialInstance
classes. In other words, GetUniform
does not work, and won't even compile (if used). So just don't worry about that for now, it will need to be fixed to retrieve data from the m_VSUserUniformBuffer
and m_PSUserUniformBuffer
buffers.Please let me know if you have any other questions, and good luck! :)
Nice work! When Linux will be done then OSX will be ready to use in no time(at least it should)!
@Murii It should, as I have been trying to use only Unix-related functions, and not linux-specific :smiley:
@TheCherno Thanks for the response. I will use then the SP_PLATFORM_WINDOWS to ignore DirectX code, and remove the GetUniform functions, at least for now. I will add comments as I make more progress.
How is this going? Are you still working on it @cubedtear?
I'm going to do a Mac build soon, so I'm wondering if there is any code you've written that would be useful for that.
@TheCherno I have been taking a break, because I have been on vacations, but I will go back to it shortly. If you want you can check my fork, where I have the CMake build files and some files ported. I have been unable to port custom memory allocation yet, so I guess you'll have better luck than me on that.
My fork is now around 2 months old, so you may want to rescue just the changes I made to some files, and the new ones.
When/If you make a Mac port issue, please tag me in a comment so I can keep up to date and/or help if I can.
Great, thanks, I'll take a look and keep you updated. :)
Any status updates on this?
Working on it right now but can't say more atm
I left it, as I do not have much experience with C++ (in particular with templates), and I have quite a bit of work from university. Sorry guys 😢
Don't worry man, I'm working on it atm. I'll take a part of your working and work on it (I've started working on it about 2month ago and just remember that you've started it =) so i take a look on your code and review all my build / configuration. I'm trying to be update with thecherno.
Okey, I will be happy to see Sparky working on Linux. It's incredible to see how many people get involved on it 😄
@Xeryko You may want to create another issue (with a checklist) to keep us updated with your progress; I for one am very interested in this.
@TheCherno Ok! Created! (Move to issue #128)
I would like to know if a functional Linux build exists for Sparky.
I know this project is relatively old compared to Hazel, but I'd still like to see how it works on a Linux system.
sp/platform/posix
Intentions
I am currently making progress on compiling Sparky-core, its dependencies and Sandbox on Linux Mint with gcc. I am using CMake in order for the build to be as portable as posible (thinking about future CI, too). Every so often I am also testing the VS project in Windows 10, to ensure I do not break anything.
For now, I am only intending to build and test Sparky (i.e. the dependencies, sparky-core, and Sandbox). The SparkyCLI (or the CLI tool, now that it is made) would make sense for Mono, but for now I think it's enough to get the engine up and running by itself for now.
Since CMake is cross-platform, I am going to try to make the CMake script able to generate not only the binaries, but also fully functional and well-structured Visual Studio solution files. Also, in order not to have to update the CMake build script each time, I am thinking about making a small tool to convert VS solution files into the CMake scripts.
I am working on my fork, which was based on 42a8de8ae3c60d23e42c39cd94c3c684ac8a721c and is updated to e79a25dd7f6e15c3212f4568b75b7868c25c42bf. However, I am going to do a clean fork and commit all the changes in one/two commits when it is all finished, as I am committing small and broken changes when I switch computers/OSs.
Progress
As of writing this, CMake scripts seem totally functional. All static and dynamic libraries are built without any problem, including Sparky-core. Sandbox builds aswell, and I get a window, but there are some platform-dependant classes (those in
sp/platform/posix
) that have not been implemented yet, because I wanted to make everything compile ASAP.There are some problems with the
new
anddelete
operator overloading and FreeImage, which I am currently investigating.Notes
I do realize my code may very well not follow the coding conventions @TheCherno uses. I have yet to configure my IDE. Once again, my fork right now is just to get it to work, no matter how dirty it has to be. I will focus on putting it all nicely afterwards.
I have not tested the CMake scripts in Windows. Making them work there will likely require some changes, due to how libraries are treated in Windows vs Linux.
Questions
SP_DIRECTX
/SP_OPENGL
), or should justSP_PLATFORM_WINDOWS
/SP_PLATFORM_UNIX
be used?sp/graphics/Material.h
, the functionsGetUniform(whatever)
referenceGetUniformDeclaration()
andm_UniformData
, which just appear in that file. What is their purpose?