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

[minifb] Bump to 2023-02-03 #29316

Merged
merged 4 commits into from
Feb 3, 2023
Merged

Conversation

xiaozhuai
Copy link
Contributor

@xiaozhuai xiaozhuai commented Jan 31, 2023

  1. Bump to 2023-02-03
  2. Fix install
  3. Add license
  4. Modernization

github-actions[bot]
github-actions bot previously approved these changes Jan 31, 2023
github-actions[bot]
github-actions bot previously approved these changes Jan 31, 2023
github-actions[bot]
github-actions bot previously approved these changes Jan 31, 2023
@xiaozhuai
Copy link
Contributor Author

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;
}

github-actions[bot]
github-actions bot previously approved these changes Jan 31, 2023
@MonicaLiu0311 MonicaLiu0311 added the category:port-update The issue is with a library, which is requesting update new revision label Jan 31, 2023
@xiaozhuai
Copy link
Contributor Author

Also open a pr on upstream emoon/minifb#102.
Please wait before merging this pr.
If upstream willing to take the change, then we can remove fix-install.patch file.

@BillyONeal
Copy link
Member

I manually checked that the SHA in here is not affected by #29288

github-actions[bot]
github-actions bot previously approved these changes Feb 1, 2023
github-actions[bot]
github-actions bot previously approved these changes Feb 1, 2023
github-actions[bot]
github-actions bot previously approved these changes Feb 2, 2023
github-actions[bot]
github-actions bot previously approved these changes Feb 3, 2023
@xiaozhuai xiaozhuai changed the title [minifb] Bump to 2023-01-30 [minifb] Bump to 2023-02-03 Feb 3, 2023
@xiaozhuai xiaozhuai marked this pull request as ready for review February 3, 2023 03:35
@xiaozhuai
Copy link
Contributor Author

xiaozhuai commented Feb 3, 2023

@MonicaLiu0311 @dg0yt @JonLiu1993 Since upstream has accepted emoon/minifb#102, I've update this pr, it's ok to be merged now.

@MonicaLiu0311 MonicaLiu0311 removed the depends:upstream-changes Waiting on a change to the upstream project label Feb 3, 2023
MonicaLiu0311
MonicaLiu0311 previously approved these changes Feb 3, 2023
@MonicaLiu0311 MonicaLiu0311 added the info:reviewed Pull Request changes follow basic guidelines label Feb 3, 2023
Copy link
Member

@BillyONeal BillyONeal left a 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!

@BillyONeal BillyONeal merged commit 9aa9cc5 into microsoft:master Feb 3, 2023
@xiaozhuai xiaozhuai deleted the dev-minifb branch February 5, 2023 06:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
category:port-update The issue is with a library, which is requesting update new revision info:reviewed Pull Request changes follow basic guidelines
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants