Video.h
Go to the documentation of this file.
1 // SPDX-License-Identifier: Beerware
6 #pragma once
7 
8 #include <SDL.h>
9 
16 typedef struct Video_t
17 {
18  SDL_Renderer* pstRenderer;
19  SDL_Window* pstWindow;
20  Sint32 s32WindowWidth;
21  Sint32 s32WindowHeight;
24  Uint8 u8RefreshRate;
25  double dZoomLevel;
27  double dTimeA;
28  double dTimeB;
29  double dDeltaTime;
30 } Video;
31 
32 void Video_Free(Video* pstVideo);
33 
34 Sint8 Video_Init(
35  const char* pacWindowTitle,
36  const Sint32 s32WindowWidth,
37  const Sint32 s32WindowHeight,
38  const Sint32 s32LogicalWindowWidth,
39  const Sint32 s32LogicalWindowHeight,
40  const SDL_bool bFullscreen,
41  Video** pstVideo);
42 
43 void Video_RenderScene(Video* pstVideo);
44 Sint8 Video_SetZoomLevel(const double dZoomLevel, Video* pstVideo);
45 Sint8 Video_ToggleFullscreen(Video* pstVideo);
void Video_Free(Video *pstVideo)
Free video.
Definition: Video.c:21
Sint32 s32LogicalWindowHeight
Logical window height in pixel.
Definition: Video.h:23
Sint8 Video_ToggleFullscreen(Video *pstVideo)
Toggle fullscreen.
Definition: Video.c:234
double dDeltaTime
Delta time.
Definition: Video.h:29
double dZoomLevel
Zoom-level.
Definition: Video.h:25
Video handle data.
Definition: Video.h:16
void Video_Free(Video *pstVideo)
Free video.
Definition: Video.c:21
SDL_Window * pstWindow
SDL2 window handle.
Definition: Video.h:19
Sint8 Video_Init(const char *pacWindowTitle, const Sint32 s32WindowWidth, const Sint32 s32WindowHeight, const Sint32 s32LogicalWindowWidth, const Sint32 s32LogicalWindowHeight, const SDL_bool bFullscreen, Video **pstVideo)
Initialise video.
Definition: Video.c:60
Sint8 Video_SetZoomLevel(const double dZoomLevel, Video *pstVideo)
Set zoom-level.
Definition: Video.c:200
void Video_RenderScene(Video *pstVideo)
Render scene.
Definition: Video.c:171
Constants include header.
Sint8 Video_SetZoomLevel(const double dZoomLevel, Video *pstVideo)
Set zoom-level.
Definition: Video.c:200
Sint32 s32WindowHeight
Window height in pixel.
Definition: Video.h:21
Sint8 Video_ToggleFullscreen(Video *pstVideo)
Toggle fullscreen.
Definition: Video.c:234
struct Video_t Video
Video handle type.
double dTimeB
Point in time B.
Definition: Video.h:28
Sint32 s32LogicalWindowWidth
Logical window width in pixel.
Definition: Video.h:22
Sint8 Video_Init(const char *pacWindowTitle, const Sint32 s32WindowWidth, const Sint32 s32WindowHeight, const Sint32 s32LogicalWindowWidth, const Sint32 s32LogicalWindowHeight, const SDL_bool bFullscreen, Video **pstVideo)
Initialise video.
Definition: Video.c:60
Uint8 u8RefreshRate
Refresh rate.
Definition: Video.h:24
void Video_RenderScene(Video *pstVideo)
Render scene.
Definition: Video.c:171
double dTimeA
Point in time A.
Definition: Video.h:27
double dInitialZoomLevel
Initial zoom-level.
Definition: Video.h:26
SDL_Renderer * pstRenderer
Pointer to SDL2 rendering context.
Definition: Video.h:18
Sint32 s32WindowWidth
Window width in pixel.
Definition: Video.h:20