50 lines
1.3 KiB
Python
50 lines
1.3 KiB
Python
from cmd_server import CmdServer, HandshakePayload, PixelKind
|
|
from while_stopper import INSTANCE as STOPPER
|
|
import logging
|
|
|
|
|
|
def receive_data() -> None:
|
|
logging.info("Data received")
|
|
|
|
|
|
def main():
|
|
server = CmdServer()
|
|
|
|
print("Please launch BasaltPresenter now.")
|
|
print("Then press Enter to continue...")
|
|
input()
|
|
|
|
logging.info("Waiting BasaltPresenter...")
|
|
server.wait_handshake(HandshakePayload(
|
|
headless=False,
|
|
pixel_kind=PixelKind.GRAY_U8,
|
|
width=600,
|
|
height=600,
|
|
engine_name="BasaltDirectX11Engine",
|
|
engine_device=0,
|
|
deliver_name="BasaltPipeDeliver",
|
|
deliver_device=0,
|
|
object_loader_name="BasaltObjObjectLoader",
|
|
object_loader_file="D:\\Repo\\BasaltMeter\\BasaltPresenter\\out\\scene.obj",
|
|
anime_loader_name="BasaltChickenNuggetAnimeLoader",
|
|
anime_loader_file="",
|
|
))
|
|
|
|
logging.info("Start to running.")
|
|
STOPPER.register()
|
|
while True:
|
|
if server.tick(receive_data, STOPPER.is_stop_requested()):
|
|
break
|
|
STOPPER.unregister()
|
|
|
|
logging.info("Program stop.")
|
|
|
|
|
|
if __name__ == "__main__":
|
|
logging.basicConfig(
|
|
level=logging.DEBUG,
|
|
format="[%(asctime)s] [%(levelname)s] %(message)s",
|
|
datefmt="%Y-%m-%d %H:%M:%S",
|
|
)
|
|
main()
|