summaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
authorTuomas Virtanen <katajakasa@gmail.com>2018-04-05 01:40:44 +0300
committerTuomas Virtanen <katajakasa@gmail.com>2018-04-05 01:40:44 +0300
commit5966b18fd054a130396432f007d2843c80a1e591 (patch)
tree08b0f0810549ab782febb5652bfa6cd7c3624a5d /examples
parentdf0ba1e67062fba5d9d6464bb6a40e808760b4dc (diff)
Cleanups
Diffstat (limited to 'examples')
-rw-r--r--examples/example_audio.c2
-rw-r--r--examples/example_video.c11
2 files changed, 4 insertions, 9 deletions
diff --git a/examples/example_audio.c b/examples/example_audio.c
index 92a1397..45cf43d 100644
--- a/examples/example_audio.c
+++ b/examples/example_audio.c
@@ -4,8 +4,6 @@
#include <stdbool.h>
/*
-* Requires SDL2 2.0.4 !
-*
* Note! This example does not do proper error handling etc.
* It is for example use only!
*/
diff --git a/examples/example_video.c b/examples/example_video.c
index 2b95b7d..72467ab 100644
--- a/examples/example_video.c
+++ b/examples/example_video.c
@@ -4,8 +4,6 @@
#include <stdbool.h>
/*
-* Requires SDL2 2.0.4 !
-*
* Note! This example does not do proper error handling etc.
* It is for example use only!
*/
@@ -96,9 +94,6 @@ int main(int argc, char *argv[]) {
return 1;
}
- // Ask for linear texture scaling (better quality)
- SDL_SetHint(SDL_HINT_RENDER_SCALE_QUALITY, "linear");
-
// Initialize Kitchensink with network and libass support.
err = Kit_Init(KIT_INIT_NETWORK|KIT_INIT_ASS);
if(err != 0) {
@@ -178,7 +173,7 @@ int main(int argc, char *argv[]) {
fprintf(stderr, "Subtitle format: %s\n", Kit_GetSDLPixelFormatString(pinfo.subtitle.format));
fflush(stderr);
- // Initialize textures
+ // Initialize video texture. This will probably end up as YV12 most of the time.
SDL_Texture *video_tex = SDL_CreateTexture(
renderer,
pinfo.video.format,
@@ -189,6 +184,8 @@ int main(int argc, char *argv[]) {
fprintf(stderr, "Error while attempting to create a video texture\n");
return 1;
}
+
+ // This is the subtitle texture atlas. This contains all the subtitle image fragments.
SDL_Texture *subtitle_tex = SDL_CreateTexture(
renderer,
pinfo.subtitle.format,
@@ -312,7 +309,7 @@ int main(int argc, char *argv[]) {
for(int i = 0; i < got; i++) {
SDL_RenderCopy(renderer, subtitle_tex, &sources[i], &targets[i]);
}
-
+
// Render GUI
if(gui_enabled) {
double percent = Kit_GetPlayerPosition(player) / Kit_GetPlayerDuration(player);