18 m_ctx->setFlushWindow(
this);
29 std::this_thread::sleep_for(std::chrono::milliseconds(1));
49 }
while (needReWaited);
80 ferr <<
"没有受支持的context" << std::endl;
94 std::this_thread::sleep_for(std::chrono::milliseconds(1));
109 }
while (needReWaited);
126 jni::GlobalObject<FCTMainActivityJavaClass>* activity = (
g_androidRuntime->getActivity());
129 aout <<
"创建窗口" << std::endl;
240 fout <<
"onSurfaceCreate" << std::endl;
245 fout <<
"NativeWindow width: " << w << std::endl;
246 fout <<
"NativeWindow height: " << h << std::endl;
254 fout <<
"onSurfaceChanged" << std::endl;
260 fout <<
"onSurfaceDestroy" << std::endl;
270 vk::AndroidSurfaceCreateInfoKHR createInfo;
301JNIEXPORT
void JNICALL
303 jni::LocalObject<FCTWindowJavaClass> window(thiz);
310JNIEXPORT
void JNICALL
312 jlong native_window_ptr) {
318JNIEXPORT
void JNICALL
321 jlong native_window_ptr) {
327JNIEXPORT
void JNICALL
329 jlong native_window_ptr,
330 jint width, jint height) {
JNIEXPORT void JNICALL Java_com_example_androidtutorial_FCTWindow_onDismiss(JNIEnv *env, jobject thiz)
JNIEXPORT void JNICALL Java_com_example_androidtutorial_FCTSurfaceView_onSurfaceCreated(JNIEnv *env, jobject thiz, jobject surface, jlong native_window_ptr)
JNIEXPORT void JNICALL Java_com_example_androidtutorial_FCTSurfaceView_onSUrfaceDestroyed(JNIEnv *env, jobject thiz, jlong native_window_ptr)
JNIEXPORT void JNICALL Java_com_example_androidtutorial_FCTSurfaceView_onSurfaceChanged(JNIEnv *env, jobject thiz, jlong native_window_ptr, jint width, jint height)
void createVulkanSurface()
std::function< void()> createSurface
std::function< void()> present
std::function< void()> destorySurface
void viewport(Vec2 lt, Vec2 rb)
void swapBuffers() override
vk::SurfaceKHR m_vulkanSurface
void bind(FCT::Context *ctx) override
jni::GlobalObject< FCTWindowJavaClass > * m_windowObject
uint32_t getDeviceHeight()
void resize(int w, int h)
uint32_t getDeviceWidth()
bool m_needRecreateSwapChain
void onSurfaceCreate(jobject surface)
void setCursorPos(int x, int y) override
std::function< void()> recreateSwapChain
void sizeParam(int w, int h)
void destroyVulkanSurface()
std::mutex m_nativeSurfaceMutex
void onSurfaceChanged(int width, int height)
VK_Swapchain * m_vkSwapchain
ANativeWindow * m_nativeWindow
bool isRunning() const override
void createVulkanSwapChain()
void title(const std::string &title)
Android_Runtime * g_androidRuntime