GithubHelp home page GithubHelp logo

ziacko / tinywindow Goto Github PK

View Code? Open in Web Editor NEW
198.0 198.0 13.0 35.43 MB

a cross platform (Linux and Windows) OpenGL window library in a single header

License: MIT License

C++ 43.77% CMake 0.65% GLSL 0.03% C 48.28% Lua 3.52% Python 3.75%
c-plus-plus cpp cross-platform header-only linux opengl opengl-library windows

tinywindow's People

Contributors

g-pechorin avatar lb-- avatar naorhadar avatar thyrgle avatar ziacko avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

tinywindow's Issues

Multiple monitors?

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?

Example project fails build on Linux

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!

Docs are in a zip file

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.

Fix Window event handling

need to implement event handling for windows that would allow windows to receive events without the use of the window manager

Crash on example window creation in visual studio 2017, windows 7, window 10 sdk

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!

On linux line 1900: else with no previous if

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

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.