A better alternative to solution files
Re: A better alternative to solution files
FinalL worked on converting the framework to use CMake & OpenGL, I'm not sure if it's in a working state or not though. Link to the repo: https://github.com/FinalL/chili_framewo ... CMakeBuild
-
- Posts: 6
- Joined: June 12th, 2017, 10:33 pm
Re: A better alternative to solution files
well, it configures but it doesn't build. there's a bunch of types not defined
Re: A better alternative to solution files
I did not make it linux compatible yet, since the sound is still work in progress but I'm gonna try to publish a lightweight version buildable on linux
Many noodles, one sauce.
'Programming rules: #1 - Everything is just a fucking number.' Chili, 2012
Mainly Discord procrastinator
'Programming rules: #1 - Everything is just a fucking number.' Chili, 2012
Mainly Discord procrastinator
Re: A better alternative to solution files
Ok I tried making it buildable on linux but GCC just refuses to build it https://github.com/FinalL/chili_framewo ... linuxbuild It builds without problems on VS 2017 but GCC keeps bitching about I really have no idea what the problem is https://pastebin.com/S0zyfZNM
Code: Select all
/root/chili_framework/Engine/Graphics.h: In member function ‘void Graphics::PutPixel(int, int, int, int, int)’:
/root/chili_framework/Engine/Graphics.h:55:23: error: expected primary-expression before ‘(’ token
PutPixel( x,y, Color( unsigned char( r ),unsigned char( g ),unsigned char( b ) ) );
Many noodles, one sauce.
'Programming rules: #1 - Everything is just a fucking number.' Chili, 2012
Mainly Discord procrastinator
'Programming rules: #1 - Everything is just a fucking number.' Chili, 2012
Mainly Discord procrastinator
-
- Posts: 4373
- Joined: February 28th, 2013, 3:23 am
- Location: Oklahoma, United States
Re: A better alternative to solution files
Don't know why it would matter, but try moving the definition of the PutPixel(int,int,int,int,int) in the .cpp file. It appears it's only seeing this version and not the overload, or it's not understanding how to construct a Color object.
Try creating the color first, then pass the newly created color to the PutPixel( int,int,Color ) overload.
Try c++ static_cast<unsigned char>
Try putting the parentheses around the ( unsigned char ) instead of around the variable names:
Try swapping the order of the PutPixel functions:
Something Visual Studio had problems with in the beginning of VS2017 life-cycle, was the fact chili used unsigned char for the parameters of the Color constructors and the class is constexpr. So VS complained about, but still compiled, the result of the bitwise or expressions would overflow even thought he result would go into a 32 bit unsigned int. Perhaps this could be the cause as well. To check, change all the Color constructor parameters to unsigned int instead of unsigned char:
Try creating the color first, then pass the newly created color to the PutPixel( int,int,Color ) overload.
Code: Select all
void PutPixel( int x, int y, int r, int g, int b )
{
const Color c( unsigned char( r ), unsigned char( g ), unsigned char( b ) );
PutPixel( x, y, c );
}
Code: Select all
void PutPixel( int x, int y, int r, int g, int b )
{
PutPixel( x, y, Color( static_cast<unsigned char>( r ), static_cast<unsigned char>( g ), static_cast<unsigned char>( b ) ) );
}
Code: Select all
void PutPixel( int x, int y, int r, int g, int b )
{
PutPixel( x, y, Color( ( unsigned char )r, ( unsigned char )g, ( unsigned char )b ) );
}
Code: Select all
void PutPixel( int x, int y, Color c );
void PutPixel( int x, int y, int r, int g, int b )
{
PutPixel( x,y, Color( unsigned char( r ),unsigned char( g ),unsigned char( b ) ) );
}
Code: Select all
constexpr Color( unsigned int x,unsigned int r,unsigned int g,unsigned int b )
:
dword( (x << 24u) | (r << 16u) | (g << 8u) | b )
{}
constexpr Color( unsigned int r,unsigned int g,unsigned int b )
:
dword( (r << 16u) | (g << 8u) | b )
{}
constexpr Color( Color col,unsigned int x )
:
Color( (x << 24u) | col.dword )
{}
If you think paging some data from disk into RAM is slow, try paging it into a simian cerebrum over a pair of optical nerves. - gameprogrammingpatterns.com
Re: A better alternative to solution files
Thanks for the suggestions papa I posted it at the discord as well and Chili took a look at it, and concluded that the GCC had trouble parsing the multi-word typename unsigned char without parentheses surrounding it. I spent some more time with it yesterday and got it now building on Linux. But now it just stays black. I suspect there's some OpenGL/glad error somewhere because the glfw window and 'rendering' loop seems to be running and responding to input. Stronger checking on GL calls would have helped, but I was too lazy. At least I get to learn debugging on Linux. Another new experience from this 'simple' task.
Many noodles, one sauce.
'Programming rules: #1 - Everything is just a fucking number.' Chili, 2012
Mainly Discord procrastinator
'Programming rules: #1 - Everything is just a fucking number.' Chili, 2012
Mainly Discord procrastinator
-
- Posts: 4373
- Joined: February 28th, 2013, 3:23 am
- Location: Oklahoma, United States
Re: A better alternative to solution files
So, static_cast<unsigned char>( value ) or (unsigned char)value or (unsigned char)(value) would work?
If you think paging some data from disk into RAM is slow, try paging it into a simian cerebrum over a pair of optical nerves. - gameprogrammingpatterns.com
Re: A better alternative to solution files
the middle one works just fine (unsigned char)value
Many noodles, one sauce.
'Programming rules: #1 - Everything is just a fucking number.' Chili, 2012
Mainly Discord procrastinator
'Programming rules: #1 - Everything is just a fucking number.' Chili, 2012
Mainly Discord procrastinator
Re: A better alternative to solution files
After a bit more tweaking than I expected, I managed to get it running on my Kali VM, you can test if it works on your machine, master on https://github.com/FinalL/chili_framework It worksruns, but needs proper thorough testing of the mouse and keyboard input, maybe a reorganisation. It's also still missing sound, I unfortunately need some more learning until I'm able to finish that. I might be able to try some more this weekend.
Many noodles, one sauce.
'Programming rules: #1 - Everything is just a fucking number.' Chili, 2012
Mainly Discord procrastinator
'Programming rules: #1 - Everything is just a fucking number.' Chili, 2012
Mainly Discord procrastinator
Re: A better alternative to solution files
When you've got a test setup for keyboard and mouse, I'd like to test it out on an Ubuntu VM. One of the things I anticipated as an annoyance would be the fact that tutorials etc. use windows VK_ codes. How does your framework handle the key codes?
Chili