window.hpp

来自「用于GPU通用计算的编程语言BrookGPU 0.4」· HPP 代码 · 共 40 行

HPP
40
字号
// window.hpp
#pragma once

#include "base.hpp"

namespace fibble {

  class Window
  {
  public:
	  static Window* create();
	  ~Window();

	  void show();
	  void hide();

    HWND getWindowHandle() { return windowHandle; }
    Context* getContext() { return context; }

    void handleEvents();

  protected:
	  Window( int inWidth = 0, int inHeight = 0 );
	  void finalize();

    virtual void handleMouseDown( int x, int y ) {}
    virtual void handleMouseUp( int x, int y ) {}
    virtual void handleMouseMove( int x, int y ) {}

    virtual LRESULT handleMessage( UINT inMessage, WPARAM wParam, LPARAM lParam );

  private:
	  HWND windowHandle;
    Context* context;

	  static const char* kWindowClassName;
	  static void registerWindowClass();
	  static LRESULT WINAPI windowCallback( HWND inWindowHandle, UINT inMessage, WPARAM wParam, LPARAM lParam );
  };
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?