mirror of
https://github.com/borgesdan/xn65
synced 2024-12-29 21:54:47 +01:00
Corrige problemas
This commit is contained in:
parent
3fcb8c26bf
commit
0525626982
@ -3,7 +3,7 @@
|
||||
#
|
||||
|
||||
# Add source to this project's executable.
|
||||
add_executable (xna WIN32 "xna.cpp" "xna.h" "platform/window-dx.cpp" "platform/device-dx.cpp" "platform/adapter-dx.cpp" "platform/swapchain-dx.cpp" "platform/rendertarget-dx.cpp" "platform/texture-dx.cpp" "platform/blendstate-dx.cpp" "platform/game-dx.cpp" "platform/clock-dx.cpp" "csharp/stream.cpp" "platform/gdevicemanager-dx.cpp" "platform/vertexinput-dx.cpp" "platform/shader-dx.cpp" "platform/rasterizerstate-dx.cpp" "platform/vertexbuffer-dx.cpp" "platform/indexbuffer-dx.cpp" "common/matrix.cpp" "platform/constbuffer-dx.cpp" "platform/databuffer-dx.cpp" "platform/samplerstate-dx.cpp" "platform/spritebatch-dx.cpp" "platform/spritefont-dx.cpp" "platform/depthstencilstate-dx.cpp" "platform/keyboard-dx.cpp" "platform/mouse-dx.cpp" "platform/gamepad-dx.cpp" "common/vectors.cpp" "platform/soundeffect-dx.cpp" "platform/displaymode-dx.cpp")
|
||||
add_executable (xna WIN32 "xna.cpp" "xna.h" "platform/window-dx.cpp" "platform/device-dx.cpp" "platform/adapter-dx.cpp" "platform/swapchain-dx.cpp" "platform/rendertarget-dx.cpp" "platform/texture-dx.cpp" "platform/blendstate-dx.cpp" "platform/game-dx.cpp" "platform/clock-dx.cpp" "csharp/stream.cpp" "platform/gdevicemanager-dx.cpp" "platform/vertexinput-dx.cpp" "platform/shader-dx.cpp" "platform/rasterizerstate-dx.cpp" "platform/vertexbuffer-dx.cpp" "platform/indexbuffer-dx.cpp" "common/matrix.cpp" "platform/constbuffer-dx.cpp" "platform/databuffer-dx.cpp" "platform/samplerstate-dx.cpp" "platform/spritebatch-dx.cpp" "platform/spritefont-dx.cpp" "platform/depthstencilstate-dx.cpp" "platform/keyboard-dx.cpp" "platform/mouse-dx.cpp" "platform/gamepad-dx.cpp" "common/vectors.cpp" "platform/soundeffect-dx.cpp" "platform/displaymode-dx.cpp" "platform/presentparameters-dx.cpp")
|
||||
|
||||
if (CMAKE_VERSION VERSION_GREATER 3.12)
|
||||
set_property(TARGET xna PROPERTY CXX_STANDARD 20)
|
||||
|
@ -19,19 +19,19 @@ namespace xna {
|
||||
_adapter = value;
|
||||
}
|
||||
|
||||
constexpr virtual xna::PresentationParameters PresentationParameters() const override{
|
||||
virtual xna::PresentationParameters PresentationParameters() const override{
|
||||
return _parameters;
|
||||
};
|
||||
|
||||
constexpr virtual void PresentationParameters(xna::PresentationParameters const& value) override{
|
||||
virtual void PresentationParameters(xna::PresentationParameters const& value) override{
|
||||
_parameters = value;
|
||||
};
|
||||
|
||||
constexpr virtual xna::GraphicsProfile GraphicsProfile() const override {
|
||||
virtual xna::GraphicsProfile GraphicsProfile() const override {
|
||||
return _profile;
|
||||
};
|
||||
|
||||
constexpr virtual void GraphicsProfile(xna::GraphicsProfile value) override {
|
||||
virtual void GraphicsProfile(xna::GraphicsProfile value) override {
|
||||
_profile = value;
|
||||
};
|
||||
|
||||
|
@ -41,13 +41,15 @@ namespace xna {
|
||||
BOOL state = false;
|
||||
auto hr = swap->dxSwapChain->GetFullscreenState(&state, nullptr);
|
||||
|
||||
if (FAILED(hr)) return;
|
||||
if (FAILED(hr)) return false;
|
||||
|
||||
hr = swap->dxSwapChain->SetFullscreenState(!state, nullptr);
|
||||
|
||||
if (FAILED(hr)) return;
|
||||
if (FAILED(hr)) return false;
|
||||
|
||||
_isFullScreen = !state;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
void GraphicsDeviceManager::PreferredBackBufferWidth(Int value) {
|
||||
@ -66,10 +68,11 @@ namespace xna {
|
||||
_information._parameters.backBufferHeight = _backBufferHeight;
|
||||
}
|
||||
|
||||
initWindow();
|
||||
initDevice();
|
||||
auto result = initWindow();
|
||||
|
||||
if (!result) return false;
|
||||
|
||||
return true;
|
||||
return initDevice();
|
||||
}
|
||||
|
||||
void GraphicsDeviceManager::ChangeDevice() {
|
||||
@ -108,5 +111,7 @@ namespace xna {
|
||||
}
|
||||
|
||||
_game->_graphicsDevice = _device;
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
@ -2,6 +2,7 @@
|
||||
#define XNA_PLATFORM_GDEVICEMANAGER_DX_HPP
|
||||
|
||||
#include "../game/gdevicemanager.hpp"
|
||||
#include "gdeviceinfo-dx.hpp"
|
||||
|
||||
namespace xna {
|
||||
class GraphicsDeviceManager : public IGraphicsDeviceManager {
|
||||
|
11
framework/platform/presentparameters-dx.cpp
Normal file
11
framework/platform/presentparameters-dx.cpp
Normal file
@ -0,0 +1,11 @@
|
||||
#include "presentparameters-dx.hpp"
|
||||
#include "gdevicemanager-dx.hpp"
|
||||
|
||||
namespace xna {
|
||||
PresentationParameters::PresentationParameters() :
|
||||
backBufferWidth(GraphicsDeviceManager::DefaultBackBufferWidth),
|
||||
backBufferHeight(GraphicsDeviceManager::DefaultBackBufferHeight) {
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -2,12 +2,13 @@
|
||||
#define XNA_PLATFORM_PRESENTPARAMETERS_DX_HPP
|
||||
|
||||
#include "../graphics/presentparams.hpp"
|
||||
#include "gdevicemanager-dx.hpp"
|
||||
#include "dxheaders.hpp"
|
||||
|
||||
namespace xna {
|
||||
class PresentationParameters : public IPresentationParameters {
|
||||
public:
|
||||
PresentationParameters();
|
||||
|
||||
virtual constexpr Uint BackBufferWidth() const override {
|
||||
return backBufferWidth;
|
||||
}
|
||||
@ -37,8 +38,8 @@ namespace xna {
|
||||
}
|
||||
|
||||
public:
|
||||
Uint backBufferWidth { GraphicsDeviceManager::DefaultBackBufferWidth };
|
||||
Uint backBufferHeight{ GraphicsDeviceManager::DefaultBackBufferHeight };
|
||||
Uint backBufferWidth {0 };
|
||||
Uint backBufferHeight{ 0 };
|
||||
SurfaceFormat backBufferFormat{ SurfaceFormat::Color };
|
||||
SwapEffect swapEffect{ SwapEffect::FlipDiscard };
|
||||
HWND windowHandle = nullptr;
|
||||
|
Loading…
x
Reference in New Issue
Block a user