mirror of
https://github.com/SFML/SFML.git
synced 2024-11-24 20:31:05 +08:00
Actually let's not
This commit is contained in:
parent
9d1e5d9acf
commit
d2ca038e2a
@ -167,7 +167,7 @@ int main()
|
|||||||
// Get the default screen
|
// Get the default screen
|
||||||
const int screen = DefaultScreen(display);
|
const int screen = DefaultScreen(display);
|
||||||
|
|
||||||
// Let's create the main window
|
// Create the main window
|
||||||
XSetWindowAttributes attributes;
|
XSetWindowAttributes attributes;
|
||||||
attributes.background_pixel = BlackPixel(display, screen);
|
attributes.background_pixel = BlackPixel(display, screen);
|
||||||
attributes.event_mask = KeyPressMask;
|
attributes.event_mask = KeyPressMask;
|
||||||
@ -189,7 +189,7 @@ int main()
|
|||||||
// Set the window's name
|
// Set the window's name
|
||||||
XStoreName(display, window, "SFML Window");
|
XStoreName(display, window, "SFML Window");
|
||||||
|
|
||||||
// Let's create the windows which will serve as containers for our SFML views
|
// Create the windows which will serve as containers for our SFML views
|
||||||
const Window view1 = XCreateWindow(display,
|
const Window view1 = XCreateWindow(display,
|
||||||
window,
|
window,
|
||||||
10,
|
10,
|
||||||
|
@ -68,7 +68,7 @@ int main()
|
|||||||
windowClass.lpszClassName = TEXT("SFML App");
|
windowClass.lpszClassName = TEXT("SFML App");
|
||||||
RegisterClass(&windowClass);
|
RegisterClass(&windowClass);
|
||||||
|
|
||||||
// Let's create the main window
|
// Create the main window
|
||||||
HWND window = CreateWindow(TEXT("SFML App"),
|
HWND window = CreateWindow(TEXT("SFML App"),
|
||||||
TEXT("SFML Win32"),
|
TEXT("SFML Win32"),
|
||||||
WS_SYSMENU | WS_VISIBLE,
|
WS_SYSMENU | WS_VISIBLE,
|
||||||
@ -84,7 +84,7 @@ int main()
|
|||||||
// Add a button for exiting
|
// Add a button for exiting
|
||||||
button = CreateWindow(TEXT("BUTTON"), TEXT("Quit"), WS_CHILD | WS_VISIBLE, 560, 440, 80, 40, window, nullptr, instance, nullptr);
|
button = CreateWindow(TEXT("BUTTON"), TEXT("Quit"), WS_CHILD | WS_VISIBLE, 560, 440, 80, 40, window, nullptr, instance, nullptr);
|
||||||
|
|
||||||
// Let's create two SFML views
|
// Create two SFML views
|
||||||
HWND view1 = CreateWindow(TEXT("STATIC"),
|
HWND view1 = CreateWindow(TEXT("STATIC"),
|
||||||
nullptr,
|
nullptr,
|
||||||
WS_CHILD | WS_VISIBLE | WS_CLIPSIBLINGS,
|
WS_CHILD | WS_VISIBLE | WS_CLIPSIBLINGS,
|
||||||
|
@ -48,7 +48,7 @@ namespace sf::priv
|
|||||||
bool glCheckError(const std::filesystem::path& file, unsigned int line, std::string_view expression);
|
bool glCheckError(const std::filesystem::path& file, unsigned int line, std::string_view expression);
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
/// Let's define a macro to quickly check every OpenGL API call
|
/// Define a macro to quickly check every OpenGL API call
|
||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
#ifdef SFML_DEBUG
|
#ifdef SFML_DEBUG
|
||||||
// In debug mode, perform a test on every OpenGL call
|
// In debug mode, perform a test on every OpenGL call
|
||||||
|
@ -418,7 +418,7 @@ int initDrm(sf::priv::Drm& drm, const char* device, const char* modeStr, unsigne
|
|||||||
// Get original display mode so we can restore display mode after program exits
|
// Get original display mode so we can restore display mode after program exits
|
||||||
drm.originalCrtc = drmModeGetCrtc(drm.fileDescriptor, drm.crtcId);
|
drm.originalCrtc = drmModeGetCrtc(drm.fileDescriptor, drm.crtcId);
|
||||||
|
|
||||||
// Let's use the current mode rather than the preferred one if the user didn't specify a mode with env vars
|
// Use the current mode rather than the preferred one if the user didn't specify a mode with env vars
|
||||||
if (!drm.mode)
|
if (!drm.mode)
|
||||||
{
|
{
|
||||||
#ifdef SFML_DEBUG
|
#ifdef SFML_DEBUG
|
||||||
|
@ -48,7 +48,7 @@ namespace sf::priv
|
|||||||
bool eglCheckError(const std::filesystem::path& file, unsigned int line, std::string_view expression);
|
bool eglCheckError(const std::filesystem::path& file, unsigned int line, std::string_view expression);
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
/// Let's define a macro to quickly check every EGL API call
|
/// Define a macro to quickly check every EGL API call
|
||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
#ifdef SFML_DEBUG
|
#ifdef SFML_DEBUG
|
||||||
|
|
||||||
|
@ -290,7 +290,7 @@ int WglContext::selectBestPixelFormat(HDC deviceContext, unsigned int bitsPerPix
|
|||||||
|
|
||||||
WglContextImpl::ensureInit();
|
WglContextImpl::ensureInit();
|
||||||
|
|
||||||
// Let's find a suitable pixel format -- first try with wglChoosePixelFormatARB
|
// Find a suitable pixel format -- first try with wglChoosePixelFormatARB
|
||||||
int bestFormat = 0;
|
int bestFormat = 0;
|
||||||
if (SF_GLAD_WGL_ARB_pixel_format)
|
if (SF_GLAD_WGL_ARB_pixel_format)
|
||||||
{
|
{
|
||||||
@ -306,7 +306,7 @@ int WglContext::selectBestPixelFormat(HDC deviceContext, unsigned int bitsPerPix
|
|||||||
0,
|
0,
|
||||||
0};
|
0};
|
||||||
|
|
||||||
// Let's check how many formats are supporting our requirements
|
// Check how many formats are supporting our requirements
|
||||||
int formats[512];
|
int formats[512];
|
||||||
UINT nbFormats = 0; // We must initialize to 0 otherwise broken drivers might fill with garbage in the following call
|
UINT nbFormats = 0; // We must initialize to 0 otherwise broken drivers might fill with garbage in the following call
|
||||||
const bool isValid = wglChoosePixelFormatARB(deviceContext, intAttributes, nullptr, 512, formats, &nbFormats) != FALSE;
|
const bool isValid = wglChoosePixelFormatARB(deviceContext, intAttributes, nullptr, 512, formats, &nbFormats) != FALSE;
|
||||||
|
Loading…
Reference in New Issue
Block a user