Add OpenGL quad integration test with texture mapping
- Add tests/RHI/OpenGL/integration/quad/ with main.cpp, CMakeLists.txt - Add GLSL shaders (quad.vert, quad.frag) for textured quad rendering - Use OpenGLVertexArray, OpenGLBuffer, OpenGLShader, OpenGLPipelineState - Add OpenGLTexture::LoadFromFile for texture loading (earth.png) - Add OpenGLSampler for texture sampling configuration - Disable depth test for 2D quad rendering - GT.ppm generated from OpenGL rendering output (0% diff on re-run)
This commit is contained in:
57
tests/RHI/OpenGL/integration/quad/CMakeLists.txt
Normal file
57
tests/RHI/OpenGL/integration/quad/CMakeLists.txt
Normal file
@@ -0,0 +1,57 @@
|
||||
cmake_minimum_required(VERSION 3.15)
|
||||
|
||||
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR})
|
||||
|
||||
project(OpenGL_Quad)
|
||||
|
||||
set(ENGINE_ROOT_DIR ${CMAKE_SOURCE_DIR}/engine)
|
||||
set(PACKAGE_DIR ${CMAKE_SOURCE_DIR}/tests/OpenGL/package)
|
||||
|
||||
add_executable(OpenGL_Quad
|
||||
WIN32
|
||||
main.cpp
|
||||
${PACKAGE_DIR}/src/glad.c
|
||||
)
|
||||
|
||||
target_include_directories(OpenGL_Quad PRIVATE
|
||||
${CMAKE_CURRENT_SOURCE_DIR}
|
||||
${ENGINE_ROOT_DIR}/include
|
||||
${PACKAGE_DIR}/include
|
||||
)
|
||||
|
||||
target_link_libraries(OpenGL_Quad PRIVATE
|
||||
opengl32
|
||||
XCEngine
|
||||
)
|
||||
|
||||
target_compile_definitions(OpenGL_Quad PRIVATE
|
||||
UNICODE
|
||||
_UNICODE
|
||||
)
|
||||
|
||||
add_custom_command(TARGET OpenGL_Quad POST_BUILD
|
||||
COMMAND ${CMAKE_COMMAND} -E copy_directory
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/Res
|
||||
$<TARGET_FILE_DIR:OpenGL_Quad>/Res
|
||||
)
|
||||
|
||||
add_custom_command(TARGET OpenGL_Quad POST_BUILD
|
||||
COMMAND ${CMAKE_COMMAND} -E copy_if_different
|
||||
${CMAKE_SOURCE_DIR}/tests/RHI/OpenGL/integration/run_integration_test.py
|
||||
$<TARGET_FILE_DIR:OpenGL_Quad>/
|
||||
COMMAND ${CMAKE_COMMAND} -E copy_if_different
|
||||
${CMAKE_SOURCE_DIR}/tests/RHI/OpenGL/integration/compare_ppm.py
|
||||
$<TARGET_FILE_DIR:OpenGL_Quad>/
|
||||
COMMAND ${CMAKE_COMMAND} -E copy_if_different
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/GT.ppm
|
||||
$<TARGET_FILE_DIR:OpenGL_Quad>/
|
||||
)
|
||||
|
||||
add_test(NAME OpenGL_Quad_Integration
|
||||
COMMAND ${Python3_EXECUTABLE} $<TARGET_FILE_DIR:OpenGL_Quad>/run_integration_test.py
|
||||
$<TARGET_FILE:OpenGL_Quad>
|
||||
quad.ppm
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/GT.ppm
|
||||
5
|
||||
WORKING_DIRECTORY $<TARGET_FILE_DIR:OpenGL_Quad>
|
||||
)
|
||||
Reference in New Issue
Block a user