serge-rgb / milton

An infinite-canvas paint program
GNU General Public License v3.0
1.53k stars 133 forks source link

Error while compiling on win10 #105

Closed KoolenDasheppi closed 5 years ago

KoolenDasheppi commented 5 years ago

Here's the log:

Microsoft (R) C/C++ Optimizing Compiler Version 19.16.27026.1 for x64
Copyright (C) Microsoft Corporation.  All rights reserved.

shadergen.cc
Microsoft (R) Incremental Linker Version 14.16.27026.1
Copyright (C) Microsoft Corporation.  All rights reserved.

/out:shadergen.exe
/debug
shadergen.obj
Generating shader code...
Shaders generated OK
        1 file(s) copied.
        1 file(s) copied.
        1 file(s) copied.
        1 file(s) copied.
Microsoft (R) Windows (R) Resource Compiler Version 10.0.10011.16384
Copyright (C) Microsoft Corporation.  All rights reserved.

Microsoft (R) C/C++ Optimizing Compiler Version 19.16.27026.1 for x64
Copyright (C) Microsoft Corporation.  All rights reserved.

unity.cc
c:\users\coolj\downloads\milton-master\third_party\imgui\imgui_impl_opengl3.cpp(180): error C3861: 'glPolygonMode': identifier not found
c:\users\coolj\downloads\milton-master\third_party\imgui\imgui_impl_opengl3.cpp(268): error C2065: 'last_polygon_mode': undeclared identifier
c:\users\coolj\downloads\milton-master\third_party\imgui\imgui_impl_opengl3.cpp(268): error C3861: 'glPolygonMode': identifier not found

I installed VS2017 Community (and before I had the build tools but that didn't seem to work), and tried to run it in cmd.exe. Didn't work, said a bunch of commands were missing. Then I tried it with the developer console that comes with Visual Studio. Then it gave me those errors up there.

KoolenDasheppi commented 5 years ago

I went to the previous commit before you updated imgui and it worked fine. I'm assuming the new version of imgui broke it.

VoOoLoX commented 5 years ago

@kool601 Add X(void, glPolygonMode, GLenum face, GLenum mode)\ to gl_functions.inl that may be all you need to do, but for me I had to change glPolygonMode(GL_FRONT_AND_BACK, (GLenum)last_polygon_mode[0]); in imgui_impl_opengl3.cpp to either glPolygonMode(GL_FRONT_AND_BACK, GL_FILL); (hackish solution) or to glPolygonMode(GL_FRONT_AND_BACK, last_polygon_mode); (better solution? not sure I'm not OpenGL expert) but also add GLenum last_polygon_mode; glGetIntegerv(GL_POLYGON_MODE, (GLint *)&last_polygon_mode);

Also this is tested on Linux so I don't know if it's gonna work on Windows (it should).

serge-rgb commented 5 years ago

Sorry about that. Submitted a quick fix and pushed!