ziacko / tinywindow Goto Github PK
View Code? Open in Web Editor NEWa cross platform (Linux and Windows) OpenGL window library in a single header
License: MIT License
a cross platform (Linux and Windows) OpenGL window library in a single header
License: MIT License
SFML has virtually no support for multiple monitors or monitor detection. I was just wondering, would it be possible to add something like this to TinyWindow? Some sort of API to determine which monitor a window geta drawn onto?
use RandR if necessary
I am using Arch linux and i tried building the example project. I get the following errors from TinyWindow.h
errors.txt
I get the same errors in any project where I use TinyWindow.
Thanks for the help!
Git is not designed to handle zip files, this is a very bad idea. Just put the docs in their own directory and commit them normally like any other code.
need to implement event handling for windows that would allow windows to receive events without the use of the window manager
I've had TinyWindow working with a previous version and msvc 2013. With the latest version combined with msvc 2017, it crashes on the following line:
glRenderingContextHandle = wglCreateContextAttribsARB(window->deviceContextHandle, NULL, attribs);
I've traced it back to where I think the problem starts - this line:
wglMakeCurrent(dummyDeviceContextHandle, glDummyContextHandle);
This returns 0, but does not set a windows error. The extension function addresses end up NULL and eventually it crashes on wglCreateContextAttribsARB(...) because the function address is NULL.
I've also noticed that there is minimal error handling. I used the following function that I found elsewhere to help debug this issue. It seems that there are dozens of windows functions that are not error checked, which I can understand for a prototype, but for the library to mature I think it will be very helpful.
auto GetLastErrorStdStr() -> std::string
{
DWORD error = GetLastError();
if (error)
{
LPVOID lpMsgBuf;
DWORD bufLen = FormatMessage(
FORMAT_MESSAGE_ALLOCATE_BUFFER |
FORMAT_MESSAGE_FROM_SYSTEM |
FORMAT_MESSAGE_IGNORE_INSERTS,
NULL,
error,
MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT),
(LPTSTR) &lpMsgBuf,
0, NULL );
if (bufLen)
{
LPCSTR lpMsgStr = (LPCSTR)lpMsgBuf;
std::string result(lpMsgStr, lpMsgStr+bufLen);
LocalFree(lpMsgBuf);
return result;
}
}
return std::string();
}
#include
#define printWinError std::cout << "\n" << LINE << " windows error " << GetLastErrorStdStr() << std::endl;
Let me know if I can do anything else to help!
At line 1286 it looks like the resolution parameter of the AddWindow function doesn't use the resolution parameter. Should this be changed to call SetResolution?
You have error, else is without if , if we are on linux platform
I changed that and put else in the #ifdef windows.
But when i run the Example.cpp, when i press space it gets segmentation fault
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.