mirror of
https://github.com/danoon2/Boxedwine.git
synced 2025-12-05 18:46:44 -06:00
forgot that Mac also uses platform/linux/platformOpenGL.cpp
This commit is contained in:
@@ -24,13 +24,14 @@
|
||||
//#include "../../source/x11/x11.h"
|
||||
#include "../../source/opengl/glcommon.h"
|
||||
|
||||
#include <GL/glx.h>
|
||||
#include <dlfcn.h>
|
||||
|
||||
BHashTable<U32, GLPixelFormatPtr> PlatformOpenGL::formatsById;
|
||||
std::vector<GLPixelFormatPtr> PlatformOpenGL::formats;
|
||||
bool PlatformOpenGL::hardwareListLoaded;
|
||||
|
||||
#if defined(__linux__)
|
||||
#include <GL/glx.h>
|
||||
#include <dlfcn.h>
|
||||
|
||||
typedef Display* (*PFNXOpenDisplay)(_Xconst char*);
|
||||
typedef int (*PFNXCloseDisplay)(Display*);
|
||||
typedef int (*PFNXFree)(void*);
|
||||
@@ -169,6 +170,27 @@ void PlatformOpenGL::init() {
|
||||
dlclose(libgl);
|
||||
}
|
||||
}
|
||||
#else
|
||||
void PlatformOpenGL::init() {
|
||||
formatsById.clear();
|
||||
formats.clear();
|
||||
hardwareListLoaded = false;
|
||||
U32 count = KSystem::getPixelFormatCount();
|
||||
for (U32 i = 1; i < count; i++) {
|
||||
GLPixelFormatPtr format = std::make_shared<GLPixelFormat>();
|
||||
format->id = i;
|
||||
format->pf = *KSystem::getPixelFormat(i);
|
||||
format->nativeId = i;
|
||||
format->depth = format->pf.cColorBits;
|
||||
format->bitsPerPixel = format->pf.cColorBits;
|
||||
formatsById.set(format->id, format);
|
||||
formats.push_back(format);
|
||||
}
|
||||
if (KSystem::videoOption == VIDEO_NORMAL) {
|
||||
//hardwareListLoaded = queryOpenGL(formatsById, formats);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
void PlatformOpenGL::iterateFormats(std::function<void(const GLPixelFormatPtr& format)> callback) {
|
||||
for (auto& format : formats) {
|
||||
|
||||
Reference in New Issue
Block a user