Skip to content
This repository has been archived by the owner on Feb 11, 2021. It is now read-only.

Commit

Permalink
Date: Thu, 12 Mar 2009 15:14:38 +0200
Browse files Browse the repository at this point in the history
From: "Mike Gorchak"
Subject: New QNX patches

In photon.tar.gz there are new files to be placed into ./src/video/photon/
directory.

qnx3.diff - new patches for QNX support. Since I've found a lot of bugs in
the new GF QNX Graphics Framework and I'm suspended development for GF
driver until already found bugs will be fixed and switched to Photon driver
implementation.

sdl.diff - I've found that renderer creation result has not been checked and
SDL shows error like: "there is no current renderer", now SDL will show
correct error which was set be renderer.
  • Loading branch information
slouken committed Mar 17, 2009
1 parent 4859664 commit d63e3f3
Show file tree
Hide file tree
Showing 12 changed files with 1,635 additions and 34 deletions.
55 changes: 54 additions & 1 deletion README.QNX
@@ -1,4 +1,57 @@
README.QNX by Mike Gorchak <mike@malva.ua>, <lestat@i.com.ua>
Last changed at 02 Mar 2009.
Last changed at 10 Mar 2009.

QNX Photon and GF drivers are under construction. Please be patient.

---------------------
-- SDL GF driver --
---------------------

Here is an additional information about SDL GF driver:
* 0. Introduction.
* 1. Environment variables which SDL GF driver supports.
* 2. Custom video modes.
* 3. Limitations.

0. Introduction.

SDL GF driver is a layer between SDL and QNX Graphics Framework (GF). Hardware
accelerated features which SDL could support depends on real hardware capabilities.

1. Environment variables which GF driver supports.

GF driver supports the following environment variables for QNX GF specific
customization options:
a) SDL_VIDEO_GF_REFRESH_RATE - refresh rate of video output in Hz. Without
this environment variable declaration SDL controls refresh rate of your
display. If this enironment variable is set to 0, SDL will control refresh
rate of display, otherwise value of SDL_VIDEO_GF_REFRESH_RATE is used for
all screen resolutions as refresh rate. This example will set 60Hz refresh
rate as refresh rate for all graphics modes:

export SDL_VIDEO_GF_REFRESH_RATE=60

2. Custom video modes.

Since most QNX graphics drivers supports GENERIC video modes, i.e. you could
specify any horizontal and vertical resolution and any refresh rate, SDL GF
driver uses its own fullscreen modes list, which could be incomplete. You could
add any custom video mode, which your QNX graphics driver supports by editing
file ./src/video/qnxgf/SDL_qnxgf.c. Custom graphics mode definition looks like

{0, 1024, 640, 60, NULL}, /* 1024x640 mode is 60Hz only */

You must specify horizontal resolution as second parameter, vertical resolution
as third parameter and refresh rate as fourth parameter. Please leave first and
last parameters as 0 and NULL. Then please send me your changes to e-mail address
which is specified in the header of this document.

3. Limitations.

There are few limitations while using SDL GF driver:

a) Since GF driver supports fullscreen modes only, when you are not specifing
SDL_WINDOW_FULLSCREEN flag, an SDL GF driver will try to find the fullscreen
graphics mode which corresponds to SDL window size. Refresh rate will be the
lowest available, if SDL_VIDEO_GF_REFRESH_RATE environment variable is not set.

8 changes: 8 additions & 0 deletions src/video/SDL_video.c
Expand Up @@ -664,6 +664,7 @@ SDL_SetFullscreenDisplayMode(const SDL_DisplayMode * mode)
SDL_SetError("Couldn't find display mode match");
return -1;
}

if (SDL_memcmp
(&fullscreen_mode, &display->fullscreen_mode,
sizeof(fullscreen_mode)) == 0) {
Expand Down Expand Up @@ -1492,6 +1493,13 @@ SDL_CreateRenderer(SDL_WindowID windowID, int index, Uint32 flags)
/* Create a new renderer instance */
window->renderer = SDL_CurrentDisplay.render_drivers[index]
.CreateRenderer(window, flags);

if (window->renderer==NULL)
{
/* Assuming renderer set its error */
return -1;
}

SDL_SelectRenderer(window->id);

return 0;
Expand Down

0 comments on commit d63e3f3

Please sign in to comment.