Skip to content

Commit

Permalink
try to switch to running VNC stream every 100 frames
Browse files Browse the repository at this point in the history
  • Loading branch information
Jan Žďárský committed Aug 5, 2024
1 parent 2e5e876 commit 48c6406
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 0 deletions.
Binary file modified opengl-render-qnx/arm/o-le-v7/opengl-render-qnx
Binary file not shown.
26 changes: 26 additions & 0 deletions opengl-render-qnx/opengl.cc
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,25 @@ void execute_initial_commands() {
}
}

void execute_switch_command() {
struct Command commands[] = {
{"/eso/bin/apps/dmdt sc 4 99", "Set display 4 (VC) to display table 99 failed with error"}
};
size_t num_commands = sizeof(commands) / sizeof(commands[0]);

for (size_t i = 0; i < num_commands; ++i) {
const char* command = commands[i].command;
const char* error_message = commands[i].error_message;
printf("Executing '%s'\n", command);

// Execute the command
int ret = system(command);
if (ret != 0) {
fprintf(stderr, "%s: %d\n", error_message, ret);
}
}
}



void execute_final_commands() {
Expand Down Expand Up @@ -834,6 +853,7 @@ int main(int argc, char* argv[]) {


int frameCount = 0;
int switchToMap = 0;
double fps = 0.0;
time_t startTime = time(NULL);

Expand Down Expand Up @@ -922,6 +942,12 @@ int main(int argc, char* argv[]) {
// Draw quad
glDrawArrays(GL_TRIANGLE_FAN, 0, 4);
eglSwapBuffers(eglDisplay, eglSurface);
switchToMap++;
if(switchToMap > 100)
{
switchToMap = 0;
execute_switch_command();
}
free(framebufferUpdate); // Free the dynamically allocated memory
}
glDeleteTextures(1, &textureID);
Expand Down

0 comments on commit 48c6406

Please sign in to comment.