Welcome, Guest. Please login or register.

Login with username, password and session length

 
Advanced search

1411423 Posts in 69363 Topics- by 58416 Members - Latest Member: JamesAGreen

April 18, 2024, 04:27:36 PM

Need hosting? Check out Digital Ocean
(more details in this thread)
TIGSource ForumsDeveloperTechnical (Moderator: ThemsAllTook)Tinywindow - My cross platform OpenGL window API
Pages: [1]
Print
Author Topic: Tinywindow - My cross platform OpenGL window API  (Read 1407 times)
ziacko
Level 0
*


View Profile
« on: January 03, 2017, 10:10:02 PM »

Hi my name is Ziyad Barakat and I would like to show you my cross platform OpenGL window API called TinyWindow which is written in modern c++ as a single header with a focus on multiple windows. you can find the project here on github https://github.com/ziacko/TinyWindow
« Last Edit: January 03, 2017, 10:16:59 PM by ziacko » Logged
Schrompf
Level 9
****

C++ professional, game dev sparetime


View Profile WWW
« Reply #1 on: January 04, 2017, 01:38:14 AM »

Had a quick look, here's my impression:

1) Thanks a lot, a minimal cross platform windowing API is a very good thing in my book
2) It could be a lot more minimal, though - why input handling?
3) Haven't found if there's a method to get the monitor's current resolution. I usually start up fullscreen with desktop resolution if the player hasn't configured anything, yet.

I'll look into this more closely once I get back to coding some day - I'd love to replace GLFW which I'm currently using. GLFW has quite some nasty hacks and workarounds for buggy Linux Window Managers, though... not sure if your lib is as mature as theirs.
Logged

Snake World, multiplayer worm eats stuff and grows DevLog
ziacko
Level 0
*


View Profile
« Reply #2 on: January 04, 2017, 02:00:54 AM »

Well I added input handling mainly so I can use this to quickly develop games and other software.

there IS a method of finding the monitor's current resolution. i Built an example CPP file that shows how here https://github.com/ziacko/TinyWindow/blob/master/Example/Example.cpp

Also I'm sad to say that my API Isn't as mature as GLFW but I am constantly working to improve it in my spare time
Logged
oahda
Level 10
*****



View Profile
« Reply #3 on: January 04, 2017, 04:48:11 AM »

Good initiative. c: Mac in the plans?
Logged

ziacko
Level 0
*


View Profile
« Reply #4 on: January 04, 2017, 04:52:14 AM »

yes. but since I don't have a mac nor can afford one it's on the backburner
Logged
Polly
Level 6
*



View Profile
« Reply #5 on: January 04, 2017, 06:39:15 AM »

Keep in mind that when you're doing fullscreen as "borderless windowed" in combination with OpenGL ( as you are ), Alt+Tab won't work correctly on some versions & configurations of Windows. I'd recommend automatically minimizing / restoring the window when focus has been lost / regained.
Logged
ziacko
Level 0
*


View Profile
« Reply #6 on: January 04, 2017, 06:42:46 AM »

I'll look into it. thanks for the info
Logged
Sik
Level 10
*****


View Profile WWW
« Reply #7 on: January 05, 2017, 04:23:09 AM »

2) It could be a lot more minimal, though - why input handling?

Keyboard and mouse events come through the window. Whoever created the window must also handle those events or at the very least pass them to something else. So even if he wanted to do that it would not be feasible unless you want to stay joystick-only, which is a bad idea =P

Keep in mind that when you're doing fullscreen as "borderless windowed" in combination with OpenGL ( as you are ), Alt+Tab won't work correctly on some versions & configurations of Windows. I'd recommend automatically minimizing / restoring the window when focus has been lost / regained.

So they broke that too? (╯°□°)╯︵ ┻━┻

Which reminds me, actually proper focus loss behavior is more messier than it sounds. You want the fullscreen window to minimize when you only have one monitor (so the user can easily switch to other tasks) and to not minimize when you have multiple (because the user is likely focusing on other monitor instead). And even then I'm not sure if that breaks some guideline. Implementing multiple monitors as one giant desktop (instead of separate desktops) was a bad idea.
Logged
Polly
Level 6
*



View Profile
« Reply #8 on: January 05, 2017, 05:12:41 AM »

Which reminds me, actually proper focus loss behavior is more messier than it sounds. You want the fullscreen window to minimize when you only have one monitor (so the user can easily switch to other tasks) and to not minimize when you have multiple (because the user is likely focusing on other monitor instead).

The problem is that when you Alt+Tab from a "borderless windowed" OpenGL application in some versions of Windows the application always remains on top ( even overlapping the Alt+Tab menu itself ).
Logged
Sik
Level 10
*****


View Profile WWW
« Reply #9 on: January 05, 2017, 10:30:32 AM »

Yikes. Also make sure to not have the "always on top" flag enabled (that's only meant for stuff that needs to be on top regardless of focus, which is pointless here because the window would always have focus when it matters).
Logged
Schrompf
Level 9
****

C++ professional, game dev sparetime


View Profile WWW
« Reply #10 on: January 06, 2017, 04:39:58 AM »

2) It could be a lot more minimal, though - why input handling?

Keyboard and mouse events come through the window. Whoever created the window must also handle those events or at the very least pass them to something else. So even if he wanted to do that it would not be feasible unless you want to stay joystick-only, which is a bad idea =P

Well, I'd prefer a simple getNativeHandle() method. For input handling I got this: https://github.com/Schrompf/sniis
Logged

Snake World, multiplayer worm eats stuff and grows DevLog
Pages: [1]
Print
Jump to:  

Theme orange-lt created by panic