The open source OpenXR runtime
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

c/main: Make peek window struct private, and fix build with old SDL2

+43 -22
+1
src/xrt/compositor/CMakeLists.txt
··· 218 218 if(XRT_FEATURE_WINDOW_PEEK) 219 219 target_sources(comp_main PRIVATE main/comp_window_peek.c) 220 220 target_link_libraries(comp_main PRIVATE ${SDL2_LIBRARIES}) 221 + target_include_directories(comp_main PRIVATE ${SDL2_INCLUDE_DIRS}) 221 222 endif() 222 223 if(WIN32) 223 224 target_sources(comp_main PRIVATE main/comp_window_mswin.c)
+1 -1
src/xrt/compositor/main/comp_renderer.c
··· 1933 1933 1934 1934 #ifdef XRT_FEATURE_WINDOW_PEEK 1935 1935 if (c->peek) { 1936 - switch (c->peek->eye) { 1936 + switch (comp_window_peek_get_eye(c->peek)) { 1937 1937 case COMP_WINDOW_PEEK_EYE_LEFT: 1938 1938 comp_window_peek_blit(c->peek, r->lr->framebuffers[0].image, r->lr->extent.width, 1939 1939 r->lr->extent.height);
+28
src/xrt/compositor/main/comp_window_peek.c
··· 14 14 15 15 #include "util/u_debug.h" 16 16 17 + #ifdef XRT_HAVE_SDL2 18 + #include <SDL2/SDL.h> 19 + #else 20 + #error "comp_window_peek.h requires SDL2" 21 + #endif 17 22 #include <SDL2/SDL_vulkan.h> 18 23 19 24 20 25 DEBUG_GET_ONCE_OPTION(window_peek, "XRT_WINDOW_PEEK", NULL) 21 26 22 27 #define PEEK_IMAGE_USAGE (VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT | VK_IMAGE_USAGE_TRANSFER_DST_BIT) 28 + 29 + struct comp_window_peek 30 + { 31 + struct comp_target_swapchain base; 32 + struct comp_compositor *c; 33 + 34 + enum comp_window_peek_eye eye; 35 + SDL_Window *window; 36 + uint32_t width, height; 37 + bool running; 38 + bool hidden; 39 + 40 + VkCommandBuffer cmd; 41 + 42 + struct os_thread_helper oth; 43 + }; 44 + 23 45 24 46 static inline struct vk_bundle * 25 47 get_vk(struct comp_window_peek *w) ··· 392 414 return; 393 415 } 394 416 } 417 + 418 + enum comp_window_peek_eye 419 + comp_window_peek_get_eye(struct comp_window_peek *w) 420 + { 421 + return w->eye; 422 + }
+13 -21
src/xrt/compositor/main/comp_window_peek.h
··· 17 17 18 18 #include "os/os_threading.h" 19 19 20 - #ifdef XRT_HAVE_SDL2 21 - #include <SDL2/SDL.h> 22 - #else 23 - #error "comp_window_peek.h requires SDL2" 24 - #endif 25 - 26 20 struct comp_compositor; 27 21 struct comp_renderer; 28 22 ··· 37 31 COMP_WINDOW_PEEK_EYE_BOTH = 2, 38 32 }; 39 33 40 - struct comp_window_peek 41 - { 42 - struct comp_target_swapchain base; 43 - struct comp_compositor *c; 44 - 45 - enum comp_window_peek_eye eye; 46 - SDL_Window *window; 47 - uint32_t width, height; 48 - bool running; 49 - bool hidden; 50 - 51 - VkCommandBuffer cmd; 52 - 53 - struct os_thread_helper oth; 54 - }; 34 + struct comp_window_peek; 55 35 56 36 struct comp_window_peek * 57 37 comp_window_peek_create(struct comp_compositor *c); ··· 61 41 62 42 void 63 43 comp_window_peek_blit(struct comp_window_peek *w, VkImage src, int32_t width, int32_t height); 44 + 45 + /*! 46 + * 47 + * Getter for the peek window's eye enum. 48 + * This is a getter function so that struct comp_window_peek can be private. 49 + * 50 + * @param[in] w The peek window struct this compositor has. 51 + * @return The eye that the peek window wants to display. 52 + * 53 + */ 54 + enum comp_window_peek_eye 55 + comp_window_peek_get_eye(struct comp_window_peek *w); 64 56 65 57 #ifdef __cplusplus 66 58 }