morphologica icon indicating copy to clipboard operation
morphologica copied to clipboard

This project can run under Windows with msys2 and gcc

Open asmwarrior opened this issue 1 year ago • 6 comments

Hi, I have just tried this project. Looks good!

I'm testing a very simple hello world project under: Windows 10, Code::Blocks IDE, msys2. Note that msys2 supplied many packages, include: freetype, glfw3, flew, opencv.

Here is the screen shot:

image

I'm not good at CMake, I can only supply Code::Blocks project files.

asmwarrior avatar Dec 16 '23 01:12 asmwarrior

image

The above image is my another test to run the test file: examples\graph1.cpp.

When I start the program, an ampty window will first pop up, and I need to wait a few seconds to see the actual graph inside the window, I'm not sure this is by design, I see it also happens in the "hello world" sample code.

asmwarrior avatar Dec 16 '23 01:12 asmwarrior

I see an error message in the console window, see below:

image

This message happens in many test cases.

asmwarrior avatar Dec 16 '23 01:12 asmwarrior

Hi! Thanks for experimenting with the code on Windows. I'm glad you had some success.

The delays you report between window and graphics are not expected, so that's definitely an issue. I wonder what's happening...

The error about failing to make the context current may well be related. you could experiment with Visual::setContext - perhaps theres a short time with this platform during which the GL env is not ready.

sebjameswml avatar Dec 17 '23 15:12 sebjameswml

Would you like to contribute build instructions for msys2?

sebjameswml avatar Dec 18 '23 13:12 sebjameswml

I can help, but I'm not good at cmake. In-fact, I'm good at Code::Blocks.

I have a change to my fork: under msys2+gcc, I have to comment out the header files, because I have no such header files, but the build still look OK

With this change, I can build your project under msys2 and mingw64 gcc.

Also, here is the Code::Blocks cbp file content:

<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<CodeBlocks_project_file>
	<FileVersion major="1" minor="6" />
	<Project>
		<Option title="glfwtest" />
		<Option pch_mode="2" />
		<Option compiler="gcc" />
		<Build>
			<Target title="Debug">
				<Option output="bin/Debug/glfwtest" prefix_auto="1" extension_auto="1" />
				<Option object_output="obj/Debug/" />
				<Option type="1" />
				<Option compiler="gcc" />
				<Compiler>
					<Add option="-g" />
				</Compiler>
			</Target>
			<Target title="Release">
				<Option output="bin/Release/glfwtest" prefix_auto="1" extension_auto="1" />
				<Option object_output="obj/Release/" />
				<Option type="1" />
				<Option compiler="gcc" />
				<Compiler>
					<Add option="-O2" />
				</Compiler>
				<Linker>
					<Add option="-s" />
				</Linker>
			</Target>
		</Build>
		<Compiler>
			<Add option="-Wall" />
			<Add option="-fexceptions" />
			<Add option="-DUSE_GLEW" />
			<Add option="-D__WIN__" />
			<Add directory="F:/code/morphologica/" />
			<Add directory="F:/msys2/mingw64/include/freetype2/" />
			<Add directory="F:/code/morphologica/include" />
		</Compiler>
		<Linker>
			<Add option="`pkg-config --libs glm`" />
			<Add option="`pkg-config --libs glfw3`" />
			<Add option="`pkg-config --libs glew`" />
			<Add option="`pkg-config --cflags freetype2`" />
			<Add library="opengl32" />
			<Add library="freetype" />
		</Linker>
		<Unit filename="main.cpp" />
		<Extensions />
	</Project>
</CodeBlocks_project_file>

You can see the include paths in the cbp file, also you can see the linker options in this cbp file.

asmwarrior avatar Dec 18 '23 14:12 asmwarrior

Thanks for the info.

sebjameswml avatar Dec 19 '23 17:12 sebjameswml

Closing this issue as I've incorporated the discussion into the code now.

sebjameswml avatar Apr 17 '24 13:04 sebjameswml