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

upgrade sdl3 #327

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open

upgrade sdl3 #327

wants to merge 3 commits into from

Conversation

T-rvw
Copy link
Contributor

@T-rvw T-rvw commented Aug 5, 2023

@T-rvw T-rvw added the Draft DO NOT merge label Aug 5, 2023
@T-rvw T-rvw force-pushed the main branch 2 times, most recently from feb0da8 to fd37097 Compare September 18, 2023 17:56
Comment on lines 252 to +258
// Center the window
SDL_DisplayMode dm;
SDL_GetDesktopDisplayMode(0, &dm);
int screenWidth = dm.w;
int screenHeight = dm.h;
int windowX = (screenWidth - width) / 2;
int windowY = (screenHeight - height) / 2;
SDL_SetWindowPosition(m_pSDLWindow, windowX, windowY);
//const SDL_DisplayMode* dm = SDL_GetCurrentDisplayMode();
//int screenWidth = dm->w;
//int screenHeight = dm->h;
//int windowX = (screenWidth - width) / 2;
//int windowY = (screenHeight - height) / 2;
//SDL_SetWindowPosition(m_pSDLWindow, windowX, windowY);
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TODO

Comment on lines +265 to +303
//if (!pFilePath)
//{
// return;
//}
//
//std::string iconFilePath = CDEDITOR_RESOURCES_ROOT_PATH;
//iconFilePath += pFilePath;
//
//int width, height, originFormat;
//int depth = 32;
//int channels = STBI_rgb_alpha;
//void* pImageData = stbi_load(iconFilePath.c_str(), &width, &height, &originFormat, STBI_rgb_alpha);
//if (nullptr == pImageData)
//{
// return;
//}
//
//uint32_t maskR, maskG, maskB, maskA;
//if constexpr(SDL_BYTEORDER == SDL_BIG_ENDIAN)
//{
// maskR = 0xff000000;
// maskG = 0x00ff0000;
// maskB = 0x0000ff00;
// maskA = 0x000000ff;
//}
//else
//{
// maskR = 0x000000ff;
// maskG = 0x0000ff00;
// maskB = 0x00ff0000;
// maskA = 0xff000000;
//}
//
//SDL_Surface* pSDLSurface = SDL_CreateRGBSurfaceFrom(pImageData, width, height, depth,
// channels * width, maskR, maskG, maskB, maskA);
//
//SDL_SetWindowIcon(m_pSDLWindow, pSDLSurface);
//SDL_FreeSurface(pSDLSurface);
//stbi_image_free(pImageData);
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TODO

@T-rvw T-rvw added WIP Work In Progress Help Wanted and removed Draft DO NOT merge labels Oct 10, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Help Wanted WIP Work In Progress
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant