samizzo / pixie Goto Github PK
View Code? Open in Web Editor NEWPixie - a minimal, cross-platform pixel framebuffer library for Windows and macOS.
License: MIT License
Pixie - a minimal, cross-platform pixel framebuffer library for Windows and macOS.
License: MIT License
Pixie doesn't compile when unicode is enabled in the project.
I made a very quick attempt.
makefile_win.zip
with the following errors.
Unfortunately, it wasn't fixable with adding #include <algorithm>
and using namespace std;
to imgui.cpp
$ make -f makefile_win
g++ -I. -Wall -DUNICODE -D_UNICODE -g -c imgui.cpp -o obj/imgui.o
imgui.cpp: In static member function 'static void Pixie::ImGui::Input(char*, int, int, int, int, int
)':
imgui.cpp:166:46: error: 'min' was not declared in this scope
166 | s_state.keyboardCursorPosition = min((mouseX - textX) / s_state.font->GetCharact
erWidth(), textLength);
| ^~~
imgui.cpp:211:50: error: 'max' was not declared in this scope
211 | s_state.keyboardCursorPosition = max(s_state.keyboardCursorPosition - 1, 0);
| ^~~
imgui.cpp:215:50: error: 'min' was not declared in this scope
215 | s_state.keyboardCursorPosition = min(s_state.keyboardCursorPosition + 1, tex
tLength);
| ^~~
imgui.cpp:278:50: error: 'min' was not declared in this scope
278 | s_state.keyboardCursorPosition = min(s_state.keyboardCursorPosition + 1, tex
tBufferLength);
| ^~~
make: *** [makefile_win:17: obj/imgui.o] Error 1
Code:
#include "pixie/pixie.cpp"
#include "pixie/imgui.h"
#include "pixie/font.h"
using Pixie::ImGui;
int main() {
Pixie::Font font;
if (!font.Load("../pixie/font.bmp", 9, 16)) {
return 1;
}
Pixie::Window window;
if (!window.Open("Hello, World!", 640, 480)) {
return 1;
}
while (!window.HasKeyGoneUp(Pixie::Key_Escape)) {
ImGui::Begin(& window, & font);
if (ImGui::Button("Hello, World!", 0, 0, 9 * 13, 16)) {
ImGui::Label("Hello, World!", 0, 16, 0);
}
ImGui::End();
if (!window.Update()) {
break;
}
}
window.Close();
}
CMakeLists.txt (don't kill me for using CMake):
cmake_minimum_required(VERSION 3.12)
project(pixie_test)
set(CMAKE_CXX_STANDARD 11)
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -framework CoreGraphics -framework AppKit")
add_library(pixie pixie/pixie.cpp)
add_library(pixie_osx pixie/pixie_osx.mm)
add_library(pixie_imgui pixie/imgui.cpp)
add_library(pixie_font pixie/font.cpp)
add_executable(pixie_test main.cpp)
target_link_libraries(pixie_test pixie pixie_osx pixie_imgui pixie_font)
Window:
That's it.
No display.
However, I CAN still press the button, and if I add a print in there (actually std::cout << ...
) it will display something in the terminal. I just... can't see the button. Yay.
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.