mirror of
https://github.com/aap/librw.git
synced 2025-02-18 02:06:33 +00:00
commit
2066cf6634
@ -1459,7 +1459,7 @@ startD3D(void)
|
|||||||
d3d9Globals.present.BackBufferHeight = height;
|
d3d9Globals.present.BackBufferHeight = height;
|
||||||
d3d9Globals.present.BackBufferFormat = format;
|
d3d9Globals.present.BackBufferFormat = format;
|
||||||
d3d9Globals.present.BackBufferCount = 1;
|
d3d9Globals.present.BackBufferCount = 1;
|
||||||
d3d9Globals.present.MultiSampleType = D3DMULTISAMPLE_NONE;
|
d3d9Globals.present.MultiSampleType = (D3DMULTISAMPLE_TYPE)d3d9Globals.msLevel;
|
||||||
d3d9Globals.present.MultiSampleQuality = 0;
|
d3d9Globals.present.MultiSampleQuality = 0;
|
||||||
d3d9Globals.present.SwapEffect = D3DSWAPEFFECT_DISCARD;
|
d3d9Globals.present.SwapEffect = D3DSWAPEFFECT_DISCARD;
|
||||||
d3d9Globals.present.hDeviceWindow = d3d9Globals.window;
|
d3d9Globals.present.hDeviceWindow = d3d9Globals.window;
|
||||||
@ -1797,6 +1797,26 @@ deviceSystem(DeviceReq req, void *arg, int32 n)
|
|||||||
rwmode->depth = findFormatDepth(d3d9Globals.modes[n].mode.Format);
|
rwmode->depth = findFormatDepth(d3d9Globals.modes[n].mode.Format);
|
||||||
rwmode->flags = d3d9Globals.modes[n].flags;
|
rwmode->flags = d3d9Globals.modes[n].flags;
|
||||||
return 1;
|
return 1;
|
||||||
|
case DEVICEGETMAXMULTISAMPLINGLEVELS:
|
||||||
|
{
|
||||||
|
assert(d3d9Globals.d3d9 != nil);
|
||||||
|
uint32 level;
|
||||||
|
DWORD quality;
|
||||||
|
for (level = D3DMULTISAMPLE_16_SAMPLES; level > D3DMULTISAMPLE_NONMASKABLE; level--) {
|
||||||
|
if (SUCCEEDED(d3d9Globals.d3d9->CheckDeviceMultiSampleType(D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, d3d9Globals.startMode.mode.Format,
|
||||||
|
!(d3d9Globals.startMode.flags & VIDEOMODEEXCLUSIVE), (D3DMULTISAMPLE_TYPE)level,
|
||||||
|
&quality)))
|
||||||
|
return level;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return 1;
|
||||||
|
case DEVICEGETMULTISAMPLINGLEVELS:
|
||||||
|
if (d3d9Globals.msLevel == 0)
|
||||||
|
return 1;
|
||||||
|
return d3d9Globals.msLevel;
|
||||||
|
case DEVICESETMULTISAMPLINGLEVELS:
|
||||||
|
d3d9Globals.msLevel = (uint32)n;
|
||||||
|
return 1;
|
||||||
}
|
}
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
@ -35,6 +35,8 @@ struct D3d9Globals
|
|||||||
int numModes;
|
int numModes;
|
||||||
int currentMode;
|
int currentMode;
|
||||||
DisplayMode startMode;
|
DisplayMode startMode;
|
||||||
|
|
||||||
|
uint32 msLevel;
|
||||||
|
|
||||||
D3DPRESENT_PARAMETERS present;
|
D3DPRESENT_PARAMETERS present;
|
||||||
|
|
||||||
|
@ -414,6 +414,25 @@ Engine::getVideoModeInfo(VideoMode *info, int32 mode)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
uint32
|
||||||
|
Engine::getMaxMultiSamplingLevels(void)
|
||||||
|
{
|
||||||
|
return engine->device.system(DEVICEGETMAXMULTISAMPLINGLEVELS, nil, 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
uint32
|
||||||
|
Engine::getMultiSamplingLevels(void)
|
||||||
|
{
|
||||||
|
return engine->device.system(DEVICEGETMULTISAMPLINGLEVELS, nil, 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
bool32
|
||||||
|
Engine::setMultiSamplingLevels(uint32 levels)
|
||||||
|
{
|
||||||
|
return engine->device.system(DEVICESETMULTISAMPLINGLEVELS, nil, levels);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
namespace null {
|
namespace null {
|
||||||
|
|
||||||
void beginUpdate(Camera*) { }
|
void beginUpdate(Camera*) { }
|
||||||
|
@ -57,6 +57,7 @@ struct GlGlobals
|
|||||||
// for opening the window
|
// for opening the window
|
||||||
int winWidth, winHeight;
|
int winWidth, winHeight;
|
||||||
const char *winTitle;
|
const char *winTitle;
|
||||||
|
uint32 numSamples;
|
||||||
} glGlobals;
|
} glGlobals;
|
||||||
|
|
||||||
Gl3Caps gl3Caps;
|
Gl3Caps gl3Caps;
|
||||||
@ -1427,7 +1428,6 @@ openGLFW(EngineOpenParams *openparams)
|
|||||||
RWERROR((ERR_GENERAL, "glfwInit() failed"));
|
RWERROR((ERR_GENERAL, "glfwInit() failed"));
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
glfwWindowHint(GLFW_SAMPLES, 0);
|
|
||||||
|
|
||||||
glGlobals.monitor = glfwGetMonitors(&glGlobals.numMonitors)[0];
|
glGlobals.monitor = glfwGetMonitors(&glGlobals.numMonitors)[0];
|
||||||
|
|
||||||
@ -1474,6 +1474,7 @@ startGLFW(void)
|
|||||||
glfwWindowHint(GLFW_GREEN_BITS, mode->mode.greenBits);
|
glfwWindowHint(GLFW_GREEN_BITS, mode->mode.greenBits);
|
||||||
glfwWindowHint(GLFW_BLUE_BITS, mode->mode.blueBits);
|
glfwWindowHint(GLFW_BLUE_BITS, mode->mode.blueBits);
|
||||||
glfwWindowHint(GLFW_REFRESH_RATE, mode->mode.refreshRate);
|
glfwWindowHint(GLFW_REFRESH_RATE, mode->mode.refreshRate);
|
||||||
|
glfwWindowHint(GLFW_SAMPLES, glGlobals.numSamples);
|
||||||
|
|
||||||
int i;
|
int i;
|
||||||
for(i = 0; profiles[i].gl; i++){
|
for(i = 0; profiles[i].gl; i++){
|
||||||
@ -1739,6 +1740,21 @@ deviceSystemGLFW(DeviceReq req, void *arg, int32 n)
|
|||||||
rwmode->flags = glGlobals.modes[n].flags;
|
rwmode->flags = glGlobals.modes[n].flags;
|
||||||
return 1;
|
return 1;
|
||||||
|
|
||||||
|
case DEVICEGETMAXMULTISAMPLINGLEVELS:
|
||||||
|
{
|
||||||
|
GLint maxSamples;
|
||||||
|
glGetIntegerv(GL_MAX_SAMPLES, &maxSamples);
|
||||||
|
if (maxSamples == 0)
|
||||||
|
return 1;
|
||||||
|
return maxSamples;
|
||||||
|
}
|
||||||
|
case DEVICEGETMULTISAMPLINGLEVELS:
|
||||||
|
if (glGlobals.numSamples == 0)
|
||||||
|
return 1;
|
||||||
|
return glGlobals.numSamples;
|
||||||
|
case DEVICESETMULTISAMPLINGLEVELS:
|
||||||
|
glGlobals.numSamples = (uint32)n;
|
||||||
|
return 1;
|
||||||
default:
|
default:
|
||||||
assert(0 && "not implemented");
|
assert(0 && "not implemented");
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -27,7 +27,13 @@ enum DeviceReq
|
|||||||
DEVICEGETNUMVIDEOMODES,
|
DEVICEGETNUMVIDEOMODES,
|
||||||
DEVICEGETCURRENTVIDEOMODE,
|
DEVICEGETCURRENTVIDEOMODE,
|
||||||
DEVICESETVIDEOMODE,
|
DEVICESETVIDEOMODE,
|
||||||
DEVICEGETVIDEOMODEINFO
|
DEVICEGETVIDEOMODEINFO,
|
||||||
|
|
||||||
|
// Multisampling
|
||||||
|
DEVICEGETMAXMULTISAMPLINGLEVELS,
|
||||||
|
DEVICEGETMULTISAMPLINGLEVELS,
|
||||||
|
DEVICESETMULTISAMPLINGLEVELS,
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
typedef int DeviceSystem(DeviceReq req, void *arg, int32 n);
|
typedef int DeviceSystem(DeviceReq req, void *arg, int32 n);
|
||||||
@ -176,6 +182,9 @@ struct Engine
|
|||||||
static bool32 setVideoMode(int32 mode);
|
static bool32 setVideoMode(int32 mode);
|
||||||
static VideoMode *getVideoModeInfo(VideoMode *info, int32 mode);
|
static VideoMode *getVideoModeInfo(VideoMode *info, int32 mode);
|
||||||
|
|
||||||
|
static uint32 getMaxMultiSamplingLevels(void);
|
||||||
|
static uint32 getMultiSamplingLevels(void);
|
||||||
|
static bool32 setMultiSamplingLevels(uint32 levels);
|
||||||
|
|
||||||
static PluginList s_plglist;
|
static PluginList s_plglist;
|
||||||
static int32 registerPlugin(int32 size, uint32 id,
|
static int32 registerPlugin(int32 size, uint32 id,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user