-
Notifications
You must be signed in to change notification settings - Fork 6.7k
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
[minifb] Bump to 2023-02-03 #29316
[minifb] Bump to 2023-02-03 #29316
Conversation
xiaozhuai
commented
Jan 31, 2023
•
edited
Loading
edited
- Bump to 2023-02-03
- Fix install
- Add license
- Modernization
Tested usage cmake_minimum_required(VERSION 3.2)
project(test_minifb)
set(CMAKE_CXX_STANDARD 14)
find_package(minifb CONFIG REQUIRED)
add_executable(test_minifb main.cpp)
target_link_libraries(test_minifb PRIVATE minifb::minifb) #include <iostream>
#include <MiniFB_cpp.h>
#include <cmath>
int main() {
const int windowWidth = 1280;
const int windowHeight = 960;
auto *window = mfb_open_ex("minifb", windowWidth, windowHeight, 0);
float scaleX, scaleY;
mfb_get_monitor_scale(window, &scaleX, &scaleY);
const int width = (int) round(float(windowWidth) * scaleX);
const int height = (int) round(float(windowHeight) * scaleY);
auto *image = new uint32_t[width * height];
do {
for (int i = 0; i < width * height; ++i) {
image[i] = rand();
}
int state = mfb_update_ex(window, image, width, height);
if (state < 0) {
window = nullptr;
break;
}
} while (mfb_wait_sync(window));
delete[] image;
return 0;
} |
Also open a pr on upstream emoon/minifb#102. |
I manually checked that the SHA in here is not affected by #29288 |
@MonicaLiu0311 @dg0yt @JonLiu1993 Since upstream has accepted emoon/minifb#102, I've update this pr, it's ok to be merged now. |
37bf393
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the update!