import renderdoc as rd
import rdtest
import os


class D3D12_RGP_Capture(rdtest.TestCase):
    demos_test_name = 'D3D12_Simple_Triangle'

    # Need to enable RGP mode before opening the capture
    def run(self):
        rd.SetConfigSetting("ExternalTool_RGPIntegration", "1")
        super().run()

    def check_capture(self):
        apiprops: rd.APIProperties = self.controller.GetAPIProperties()

        if not apiprops.rgpCapture:
            rdtest.log.print("RGP capture not tested")
            return

        import tkinter

        # On D3D12 we need to create a real window
        window = tkinter.Tk()
        window.geometry("1280x720")

        path = self.controller.CreateRGPProfile(rd.CreateWin32WindowingData(int(window.frame(), 16)))

        rdtest.log.print("RGP capture created: '{}'".format(path))

        if os.path.exists(path) and os.path.getsize(path) > 100:
            rdtest.log.success("RGP capture created successfully")
        else:
            raise rdtest.TestFailureException("RGP capture failed")


@@ -41,16 +41,85 @@
 ort os%0A%0A
+try:%0A    import tkinter%0Aexcept ImportError as ex:%0A    tkinter = None%0A
 %0Aclass D
@@ -200,16 +200,188 @@
 angle'%0A%0A
+    def check_support(self):%0A        if tkinter is None:%0A            return False, 'tkinter is required but not available'%0A        %0A        return super().check_support()%0A%0A
     # Ne
@@ -752,31 +752,8 @@
 rn%0A%0A
-        import tkinter%0A
 %0A   

Handle tkinter not importing and disable relevant test. Closes #1668