See https://www.ics.com/blog/combining-qt-widgets-and-qml-qwidgetcreatewindowcontainer
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM ubuntu:18.04 | |
# MAINTAINER alex | |
# Give docker the rights to access X-server | |
# xhost +local:docker | |
# Run a terminal in container | |
# sudo docker run -it --rm -e DISPLAY -v /tmp/.X11-unix:/tmp/.X11-unix my-docker-gcc | |
# an example of how to build (with Makefile generated from cmake) inside the container |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 3.10 is the version I'm using, but if you're on a lower version feel free to comment out this line and report back results... | |
cmake_minimum_required(VERSION 3.10) | |
project(cftf) | |
# set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -stdlib=libc++ -lc++abi") | |
find_package(Clang REQUIRED CONFIG HINTS /usr/bin /usr/lib64/cmake/clang) | |
find_package(LLVM REQUIRED CONFIG HINTS /usr/lib/llvm-6.0 /usr/lib64/cmake/llvm) | |
add_executable(cftf constexpr_if.cpp main.cpp rewriter.cpp structured_bindings.cpp template_specializer.cpp) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// Compile for emscripten using | |
// emcc -Iinclude SingleFileOpenGLTex.cpp \ | |
-O2 -std=c++14 -s TOTAL_MEMORY=33554432 -s USE_SDL_IMAGE=2 -s SDL2_IMAGE_FORMATS='["png"]' --preload-file examples/data -s USE_SDL=2 -o html/SingleFileOpenGLTex.html | |
// where the following images must be located in a subfolder | |
// - examples/data/test.png | |
// - examples/data/cartman.png | |
// - examples/data/cube-negx.png | |
// - examples/data/cube-negz.png | |
// |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// g++ `pkg-config cairo-ft --cflags --libs` -lglut main.cpp | |
#include <iostream> | |
#include <vector> | |
#include <algorithm> | |
#include <cassert> | |
#ifdef _MSC_VER | |
#include <windows.h> | |
#include <cairo.h> | |
#pragma comment(lib, "cairo.lib") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <GLFW/glfw3.h> | |
#include <yoga/Yoga.h> | |
#include <stdlib.h> | |
int main(void) | |
{ | |
GLFWwindow* window; | |
/* Initialize the library */ | |
if (!glfwInit()) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
Type-safe enum class bitmasks. | |
Based on work by Andre Haupt from his blog at | |
http://blog.bitwigglers.org/using-enum-classes-as-type-safe-bitmasks/ | |
To enable enum classes to be used as bitmasks, use the ENABLE_BITMASK_OPERATORS | |
macro: | |
enum class MyBitmask { | |
None = 0b0000, | |
One = 0b0001, | |
Two = 0b0010, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* Note: this Google copyright notice only applies to the original file, which has large sections copy-pasted here. my changes are under CC0 (public domain). | |
* Copyright 2015 Google Inc. | |
* | |
* Use of this source code is governed by a BSD-style license that can be | |
* found in the LICENSE file. | |
*/ | |
/* | |
this is intended as a second-resort, after trying to build using the official instructions inevitably fails because of poor documentation and strange build systems. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SetOutputFilter DEFLATE |
Some .png
images used in pygame may get the warning read as "libpng warning: iCCP: known incorrect sRGB profile". To solve this I have searched and found the solution by using ImageMagick. After installing, single file can be fixed by calling convert <in_img> -strip <out_img>
, but to make it fixes every wanted images in path we'll need to modify just a little bit.
Create .bat
file contains the following code and place this .bat
in the folder that want to be fixed and run to finish it out.
@echo off
ping -n 2 127.0.0.1 > nul
echo this batch will convert ".png" using -strip option from ImageMagick.