Skip to content
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

opengl initializing (windows 11, MSVC 2022 preview) #22

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
120 changes: 1 addition & 119 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,121 +1,3 @@
# Introduction

UI framework that uses [Skia](https://skia.org/) as a low-level drawing toolkit.
It uses the newest features of the C++ Standard library (currently targetting C++17).

# Status

SkUI is in a pre-release development phase, and the API is definitely not stable.

[![Build Status](https://travis-ci.com/skui-org/skui.svg?branch=master)](https://travis-ci.com/skui-org/skui)
[![Build status](https://ci.appveyor.com/api/projects/status/s9t7o9k8u0p15e0x?svg=true)](https://ci.appveyor.com/project/RubenVanBoxem/skui)
[![codecov](https://codecov.io/gh/skui-org/skui/branch/master/graph/badge.svg)](https://codecov.io/gh/skui-org/skui)
[![Codacy Badge](https://api.codacy.com/project/badge/Grade/e461d12770cf4234b7d5a1ffcd880c2c)](https://www.codacy.com/manual/rubenvb/skui?utm_source=github.com&utm_medium=referral&utm_content=skui-org/skui&utm_campaign=Badge_Grade)

| Operating System | Compiler | Supported | Notes |
|------------------| ------------------------|--------------------| ----- |
| Windows | Visual Studio 2019 | :heavy_check_mark: | |
| Windows | VS 2019 Clang/LLVM 8.0+ | :heavy_check_mark: | |
| Windows | Visual Studio 2017 | :heavy_check_mark: | |
| Windows | VS 2017 Clang/LLVM 6.0+ | :heavy_check_mark: | |
| Windows | MinGW-w64 GCC 7.3+ | :heavy_check_mark: | Requires usable std::filesystem implementation. |
| Windows | MinGW-w64 Clang 6.0+ | :heavy_check_mark: | Requires usable std::filesystem implementation. |
| Windows | Intel C++ 19 | :x: | Lacks required C++17 features. |
| Linux | GCC 7.3+ | :heavy_check_mark: | |
| Linux | Clang 6.0+ | :heavy_check_mark: | |
| Linux | Intel C++ 19 | :x: | Lacks required C++17 features. |
| Mac OS X 10.15+ | XCode 11.6+ Clang | :soon: | Missing implementation of core window/application classes. |
| Mac OS X 10.15+ | Homebrew GCC 7.3+ | :soon: | Missing implementation of core window/application classes. |
| Mac OS X 10.15+ | Homebrew Clang 6.0+ | :soon: | Missing implementation of core window/application classes. |

# Components

SkUI is subdivided in several modules which can depend on other modules but shouldn't become a dependency mess:

* Core: basic functionality, including signals, properties, strings, paths, application, os abstraction...
* CSS: CSS parser built on top of Boost.Spirit X3.
* Graphics: graphical functionality such as canvases, contexts, shapes, text, ...
* GUI: abstraction of platform-specific UI code, including event loops, windows, input, ...
* OpenGL: abstraction of platform-specific OpenGL initialization code, header differences, ...
* ...
* Examples: example programs showing SkUI features
* Tests: unit tests for various components to ensure correct and expected behaviour now and in the future.

This list will grow (and change) as the library's design takes shape.

# How to get started

Clone this repository

git clone https://github.com/skui-org/skui.git

After cloning this repository, make sure the submodules are up to date

cd skui
git submodule update --init --recursive

Create and navigate to a seperate build directory, e.g.

mkdir ../skui-build
cd ../skui-build

Run CMake (here, the [ninja](https://ninja-build.org/) build system is used, but any generator should work fine)

cmake ../skui -G Ninja

This step should inform you of any missing dependencies.
Then build

cmake --build .

And run the tests to ensure nothing is wrong

ctest

# Roadmap

## 0.0.x

* establish a logical basis for UI functionality, including:
* signals, properties, strings
* basic drawing functionality
* event handling
* basic UI controls and layout engine
* Application window and event abstraction
* Windows
* Linux
* OS X
* ...

## 0.1.x

* OS Notification system implementation
* taskbar icon
* notifications
* ...
* Improve core logic and functionality.
* OS theming of all controls and windows

## 0.x.x

* More application logic (model/views, ...)
* process handling
* advanced drawing
* advanced UI controls, including:
* scrollbars
* tables, lists, etc.
* File I/O systems?
* Add missing unit tests
* Add missing documentation
* ...

## 1.x.x

* Stability and features of a basic UI framework
* Improve platform support
* Solve all them bugs.
* Correct all them documentation typos.

## x.x.x

* Supreme world domination through superiour benevolent A.I.
fork from skui - https://github.com/skui-org/skui
3 changes: 2 additions & 1 deletion core/library_windows.c++
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,8 @@ namespace skui::core
path directory = fs::absolute(filename).remove_filename();
path filename_only = filename.filename();

std::array<path, 3> filenames{{directory / filename_only,
std::array<path, 4> filenames{{filename_only,
directory / filename_only,
directory / (filename_only + dll_suffix),
directory / (dll_prefix + filename_only + dll_suffix)}};

Expand Down
1 change: 1 addition & 0 deletions gui/native_visual.h++
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ namespace skui::gui::native_visual

virtual void create_surface(std::uintptr_t window) = 0;
virtual void make_current() const = 0;
virtual void make_release() const {};
virtual void swap_buffers(const graphics::pixel_size& size) const = 0;

using gl_function_type = void(*)();
Expand Down
5 changes: 5 additions & 0 deletions gui/native_visual/wgl.c++
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,11 @@ namespace skui::gui::native_visual
core::debug_print("Failed making WGL Context current.\n");
}

void wgl::make_release() const
{
wglMakeCurrent(device_context, nullptr);
}

base::gl_get_function_type wgl::get_gl_function() const
{
return &get_gl;
Expand Down
1 change: 1 addition & 0 deletions gui/native_visual/wgl.h++
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ namespace skui::gui::native_visual
void create_surface(std::uintptr_t window) override;
void swap_buffers(const graphics::pixel_size&) const override;
void make_current() const override;
void make_release() const override;

gl_get_function_type get_gl_function() const override;

Expand Down
1 change: 1 addition & 0 deletions gui/window.c++
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,7 @@ namespace skui::gui
const auto& native_visual = native_window->get_native_visual();
native_visual.make_current();
graphics_context = std::make_unique<graphics::skia_gl_context>(native_visual.get_gl_function());
native_visual.make_release();
}
else
{
Expand Down