-
-
Notifications
You must be signed in to change notification settings - Fork 10.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Standalone Windows and OSX OpenGL sample (no dependencies) #281
Conversation
- No GLFW / GL3W - Support for High DPI Displays
Thanks! NB those two files probably ought to be removed: |
I had a look at the wgl example but it looks like it needs lots of work to be readable, not full of noise and constructed like the other examples. Moreover I'm not sure if following a base from 2000 is good idea? (unless this is still the common way to setup a windows / gl example). |
I think the restructuring of the other examples has been happening after this PR, so I had no "guideline" reference then ;) The question is if this is of any interest or everyone just uses SDL, GLFW etc. |
I think it is useful as reference. Started to clean it up myself and i got sidetracked slash discouraged with the amount of unnecessary crap ("// set the flag to true") but mostly I wondered if the basic logic was still valid for a Win32 app. If we think it is we can finish the cleanup. |
I think it's a great idea to include a no-external-dependencies example. However, at least on Windows, this sample doesn't appear to follow the https://www.opengl.org/wiki/Creating_an_OpenGL_Context_(WGL)#Proper_Context_Creation On 15 October 2015 at 19:08, omar [email protected] wrote:
|
Thanks, this is the sort of link I was hoping. That code was too old, we could use this to rewrite something based on the a mix of the GL and DirectX (for inputs, message pumping) example. |
I don't understand why the highDpiScale variable exist. It was ruining mouse coordinates until I resize the window then it picks the right coords. And it was making the font quality bad. Removing that variable fixed both issues. |
@Pagghiu Been resurrecting the raw OSX example. One of the reason is that it will be useful for the upcoming viewport branch to have a viewport-compatible low-level implementation for more systems. In particular because GLFW doesn't currently provide all the features necessary for the current viewport implementation. Hopefully it will soon. (Also the splitting of backend between platform and renderer also makes extra examples easier to maintain). Pacome helped me bring this up to date with latest best practices (reference counting), and I've been cleaning up to the best of my extents (read: struggling using a Mac). I can add you to the private branch if you want to look at it. The aim is to have a clean V1 of imgui_impl_osx.mm that doesn't support viewport (easy) then evolve that to a viewport-compatible version. Things to do for V1
Why did your code have things such as: if (g_windowHeight == 0)
g_windowHeight = 1;
..
if (g_backingHeight == 0)
g_backingHeight = g_windowHeight * 2; etc. |
void IMGUIExample_InitImGui() | ||
{ | ||
ImGuiIO& io = ImGui::GetIO(); | ||
// Time elapsed since last frame, in seconds |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this comment is in a wrong place
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@sivu don’t worry about the PR details so much, it’s a super old PR. I’m now looking into splitting the code to integrate in the new examples/ folder being used in the viewport branch.
@Pagghiu Closing this ooooold PR, moving to #1873 for the OSX code.
I think this wasn't an issue with the Xcode/sdk version you used back then but now it is. A raw win32 + OpenGL example is missing should be much easier to do right now (by combining imgui_impl_win32.cpp + imgui_impl_openglx + some WGL cruft in main.cpp to create the GL context, if someone is tempted to do it. (Ref https://github.com/Pagghiu/imgui/blob/f82b0d8c728fda72c877634b82c1a9784e026ce4/examples/opengl_example/main_without_deps.cpp) |
Excellent! |
This is a continuation of #135 updated to latest imgui master