本文整理汇总了Python中sdl2.SDL_DestroyWindow方法的典型用法代码示例。如果您正苦于以下问题:Python sdl2.SDL_DestroyWindow方法的具体用法?Python sdl2.SDL_DestroyWindow怎么用?Python sdl2.SDL_DestroyWindow使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类sdl2
的用法示例。
在下文中一共展示了sdl2.SDL_DestroyWindow方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: release
# 需要导入模块: import sdl2 [as 别名]
# 或者: from sdl2 import SDL_DestroyWindow [as 别名]
def release(self):
#cleanup
vkFreeMemory(self.device, self.depth_mem, None)
for i in self.framebuffers:
vkDestroyFramebuffer(self.device, i, None)
if self.setup_cmd:
vkFreeCommandBuffers(self.device, self.cmd_pool, 1, [self.setup_cmd])
vkFreeCommandBuffers(self.device, self.cmd_pool, 1, [self.draw_cmd])
vkDestroyCommandPool(self.device, self.cmd_pool, None)
vkDestroyRenderPass(self.device, self.render_pass, None)
for i in self.views:
vkDestroyImageView(self.device, i, None)
vkDestroyImageView(self.device, self.depth_view, None)
vkDestroyImage(self.device, self.depth_image, None)
self.vkDestroySwapchainKHR(self.device, self.swapchain, None)
vkDestroyDevice(self.device, None)
self.vkDestroyDebugReportCallbackEXT(self.inst, self.debug_callback, None)
self.vkDestroySurfaceKHR(self.inst, self.surface, None)
vkDestroyInstance(self.inst, None)
sdl2.SDL_DestroyWindow(self.window)
sdl2.SDL_Quit()
示例2: terminate
# 需要导入模块: import sdl2 [as 别名]
# 或者: from sdl2 import SDL_DestroyWindow [as 别名]
def terminate(self):
"""Cleanup the GUI resources."""
self._renderer.cleanup()
if hienoi.renderer.get_info().api == GraphicsAPI.OPENGL:
sdl2.SDL_GL_DeleteContext(self._handles.renderer.context)
sdl2.SDL_DestroyWindow(self._handles.window)
sdl2.SDL_Quit()
示例3: close
# 需要导入模块: import sdl2 [as 别名]
# 或者: from sdl2 import SDL_DestroyWindow [as 别名]
def close(self):
logger.debug("SDL2 window closed")
sdl2.SDL_DestroyWindow(self.window)
sdl2.SDL_Quit()
示例4: unload
# 需要导入模块: import sdl2 [as 别名]
# 或者: from sdl2 import SDL_DestroyWindow [as 别名]
def unload():
for texture in loaded_textures.values():
sdl2.SDL_DestroyTexture(texture[0])
sdl2.SDL_DestroyRenderer(renderer)
sdl2.SDL_DestroyWindow(window)
sdlimage.IMG_Quit()
sdlttf.TTF_Quit()
sdl2.SDL_Quit()
示例5: run
# 需要导入模块: import sdl2 [as 别名]
# 或者: from sdl2 import SDL_DestroyWindow [as 别名]
def run():
sdl2.SDL_Init(sdl2.SDL_INIT_VIDEO)
window = sdl2.SDL_CreateWindow(b"Hello World",
sdl2.SDL_WINDOWPOS_CENTERED,
sdl2.SDL_WINDOWPOS_CENTERED,
592, 460, sdl2.SDL_WINDOW_SHOWN)
fname = os.path.join(os.path.dirname(os.path.abspath(__file__)),
"resources", "hello.bmp")
image = sdl2.SDL_LoadBMP(fname.encode("utf-8"))
windowsurface = sdl2.SDL_GetWindowSurface(window)
sdl2.SDL_BlitSurface(image, None, windowsurface, None)
sdl2.SDL_UpdateWindowSurface(window)
sdl2.SDL_FreeSurface(image)
running = True
event = sdl2.SDL_Event()
while running:
while sdl2.SDL_PollEvent(ctypes.byref(event)) != 0:
if event.type == sdl2.SDL_QUIT:
running = False
break
sdl2.SDL_Delay(10)
sdl2.SDL_DestroyWindow(window)
sdl2.SDL_Quit()
return 0
示例6: quit
# 需要导入模块: import sdl2 [as 别名]
# 或者: from sdl2 import SDL_DestroyWindow [as 别名]
def quit(self):
self.is_running = False
# Give time for the other thread to end
ti.sleep(0.05)
# Destroy the SDL context
sdl2.SDL_DestroyRenderer(self.renderer)
sdl2.SDL_HideWindow(self.window)
sdl2.SDL_DestroyWindow(self.window)
sdl2.SDL_Quit()
示例7: _clean_up
# 需要导入模块: import sdl2 [as 别名]
# 或者: from sdl2 import SDL_DestroyWindow [as 别名]
def _clean_up(self):
self.logger.info("Destroying application: %s", self.name)
self._destroy_resources()
if self.renderer:
sdl2.SDL_DestroyRenderer(self.renderer)
if self.window:
sdl2.SDL_HideWindow(self.window)
sdl2.SDL_DestroyWindow(self.window)
sdl2.SDL_Quit()
示例8: run
# 需要导入模块: import sdl2 [as 别名]
# 或者: from sdl2 import SDL_DestroyWindow [as 别名]
def run():
if sdl2.SDL_Init(sdl2.SDL_INIT_VIDEO) != 0:
print(sdl2.SDL_GetError())
return -1
window = sdl2.SDL_CreateWindow(b"OpenGL demo",
sdl2.SDL_WINDOWPOS_UNDEFINED,
sdl2.SDL_WINDOWPOS_UNDEFINED, 800, 600,
sdl2.SDL_WINDOW_OPENGL)
if not window:
print(sdl2.SDL_GetError())
return -1
context = sdl2.SDL_GL_CreateContext(window)
GL.glMatrixMode(GL.GL_PROJECTION | GL.GL_MODELVIEW)
GL.glLoadIdentity()
GL.glOrtho(-400, 400, 300, -300, 0, 1)
x = 0.0
y = 30.0
event = sdl2.SDL_Event()
running = True
while running:
while sdl2.SDL_PollEvent(ctypes.byref(event)) != 0:
if event.type == sdl2.SDL_QUIT:
running = False
GL.glClearColor(0, 0, 0, 1)
GL.glClear(GL.GL_COLOR_BUFFER_BIT)
GL.glRotatef(10.0, 0.0, 0.0, 1.0)
GL.glBegin(GL.GL_TRIANGLES)
GL.glColor3f(1.0, 0.0, 0.0)
GL.glVertex2f(x, y + 90.0)
GL.glColor3f(0.0, 1.0, 0.0)
GL.glVertex2f(x + 90.0, y - 90.0)
GL.glColor3f(0.0, 0.0, 1.0)
GL.glVertex2f(x - 90.0, y - 90.0)
GL.glEnd()
sdl2.SDL_GL_SwapWindow(window)
sdl2.SDL_Delay(10)
sdl2.SDL_GL_DeleteContext(context)
sdl2.SDL_DestroyWindow(window)
sdl2.SDL_Quit()
return 0