26 virtual void pos(
int x,
int y) = 0;
27 virtual void size(
int w,
int h) = 0;
34 using VFuncII = std::function<void(
int,
int)>;
78 void pos(
int x,
int y) {
114 ferr <<
"未 bind Context" << std::endl;
162 template<
typename... Components>
167 template<
typename Component>
178 if constexpr (std::is_same_v<Component, WindowModule::Swapchain>) {
180 }
else if constexpr (std::is_same_v<Component, WindowModule::AutoViewport>) {
182 }
else if constexpr (std::is_same_v<Component, WindowModule::DepthStencil>) {
185 static_assert(
sizeof(Component) == 0,
"Unsupported module type");
213 void pos(
int x,
int y)
override {
217 void size(
int w,
int h)
override {
#define FCT_DECLARE_FLAGS(BitType)
void title(const std::string &title) override
void size(int w, int h) override
void pos(int x, int y) override
SetParamWindowBehavior(Window *window)
virtual void * getNativeHandler()=0
virtual ~SwapchainTargetWrapper()=default
virtual void size(int w, int h)=0
virtual void title(const std::string &title)=0
virtual void pos(int x, int y)=0
uint32_t getSwapchainImageCount() const
virtual bool isRunning() const =0
Image * targetImage() const
std::vector< EventHandler * > m_handlers
virtual Vec2 getCursorPos() const =0
bool m_needEnableDepthBuffer
WindowBehavior * m_behavior
RenderTargetType getType() const override
void addRenderFinshFence(RHI::Fence *fence)
void setPresentFinshSemaphore(RHI::Semaphore *semaphore)
virtual SwapchainTargetWrapper * getSwapchainTarget(Context *ctx)=0
void title(const std::string &title)
void create(WindowCreateFlags flags=WindowCreateFlag::defaultConfig)
virtual void setCursorPos(int x, int y)=0
Format m_depthBufferFormat
virtual void swapBuffers()=0
void addSingleComponent(const WindowModule::Swapchain &component)
auto getModule() const -> std::conditional_t< std::is_same_v< Component, WindowModule::Swapchain >, RHI::Swapchain *, std::conditional_t< std::is_same_v< Component, WindowModule::AutoViewport >, AutoViewport *, std::conditional_t< std::is_same_v< Component, WindowModule::DepthStencil >, Format, void * > > >
Samples getSwapchainSampleCount() const
void enableDepthBuffer(Format format)
void clearRenderFinshFences()
RHI::Swapchain * swapchain() const
void bind(Context *ctx) override
void clearRenderFinshSemaphores()
void addModule(Components &&... components)
virtual int getHeight()=0
void addRenderFinshSemaphore(RHI::Semaphore *semaphore)
AutoViewport * m_autoViewport
ImageRenderTarget * getCurrentTarget()
CallBackEventHandler * getCallBack() const
RHI::Swapchain * m_swapchain
void registerHandler(EventHandler *handler)
virtual void createPlatform()=0
CallBackEventHandler * m_callbackHandler
void unregisterHandler(EventHandler *handler)
friend class SetParamWindowBehavior
EventDispatcher< EventSystemConfig::IdentifierTriggerOnly > m_delayModuleCreate
@ withDefaultDepthStencil
IEventSystem< Config > EventDispatcher
std::function< void(int, int)> VFuncII
AutoViewport(uint32_t w, uint32_t h)
Swapchain(Context *context)