Commit 483f2ba3 authored by Sam Lantinga's avatar Sam Lantinga

indent

--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%403608
parent 3071101f
...@@ -174,7 +174,8 @@ void ...@@ -174,7 +174,8 @@ void
drawBlank(int x, int y) drawBlank(int x, int y)
{ {
SDL_Rect rect = { x, y, GLYPH_SIZE_SCREEN, GLYPH_SIZE_SCREEN }; SDL_Rect rect = { x, y, GLYPH_SIZE_SCREEN, GLYPH_SIZE_SCREEN };
SDL_SetRenderDrawColor(bg_color.r, bg_color.g, bg_color.b, bg_color.unused); SDL_SetRenderDrawColor(bg_color.r, bg_color.g, bg_color.b,
bg_color.unused);
SDL_RenderFill(&rect); SDL_RenderFill(&rect);
} }
...@@ -254,7 +255,8 @@ main(int argc, char *argv[]) ...@@ -254,7 +255,8 @@ main(int argc, char *argv[])
loadFont(); loadFont();
/* draw the background, we'll just paint over it */ /* draw the background, we'll just paint over it */
SDL_SetRenderDrawColor(bg_color.r, bg_color.g, bg_color.b, bg_color.unused); SDL_SetRenderDrawColor(bg_color.r, bg_color.g, bg_color.b,
bg_color.unused);
SDL_RenderFill(NULL); SDL_RenderFill(NULL);
SDL_RenderPresent(); SDL_RenderPresent();
......
...@@ -973,7 +973,8 @@ extern "C" ...@@ -973,7 +973,8 @@ extern "C"
/* GL_OES_query_matrix */ /* GL_OES_query_matrix */
#ifndef GL_OES_query_matrix #ifndef GL_OES_query_matrix
#define GL_OES_query_matrix 1 #define GL_OES_query_matrix 1
GL_API GLbitfield GL_APIENTRY glQueryMatrixxOES(GLfixed mantissa[16], GLint exponent[16]); GL_API GLbitfield GL_APIENTRY glQueryMatrixxOES(GLfixed mantissa[16],
GLint exponent[16]);
#endif /* GL_OES_query_matrix */ #endif /* GL_OES_query_matrix */
/* GL_OES_point_sprite */ /* GL_OES_point_sprite */
...@@ -984,25 +985,34 @@ extern "C" ...@@ -984,25 +985,34 @@ extern "C"
/* GL_OES_draw_texture */ /* GL_OES_draw_texture */
#ifndef GL_OES_draw_texture #ifndef GL_OES_draw_texture
#define GL_OES_draw_texture 1 #define GL_OES_draw_texture 1
GL_API void GL_APIENTRY glDrawTexsOES (GLshort x, GLshort y, GLshort z, GLshort width, GLshort height); GL_API void GL_APIENTRY glDrawTexsOES(GLshort x, GLshort y, GLshort z,
GL_API void GL_APIENTRY glDrawTexiOES (GLint x, GLint y, GLint z, GLint width, GLint height); GLshort width, GLshort height);
GL_API void GL_APIENTRY glDrawTexxOES (GLfixed x, GLfixed y, GLfixed z, GLfixed width, GLfixed height); GL_API void GL_APIENTRY glDrawTexiOES(GLint x, GLint y, GLint z,
GL_API void GL_APIENTRY glDrawTexsvOES (const GLshort *coords); GLint width, GLint height);
GL_API void GL_APIENTRY glDrawTexivOES (const GLint *coords); GL_API void GL_APIENTRY glDrawTexxOES(GLfixed x, GLfixed y, GLfixed z,
GL_API void GL_APIENTRY glDrawTexxvOES (const GLfixed *coords); GLfixed width, GLfixed height);
GL_API void GL_APIENTRY glDrawTexfOES (GLfloat x, GLfloat y, GLfloat z, GLfloat width, GLfloat height); GL_API void GL_APIENTRY glDrawTexsvOES(const GLshort * coords);
GL_API void GL_APIENTRY glDrawTexfvOES (const GLfloat *coords); GL_API void GL_APIENTRY glDrawTexivOES(const GLint * coords);
GL_API void GL_APIENTRY glDrawTexxvOES(const GLfixed * coords);
GL_API void GL_APIENTRY glDrawTexfOES(GLfloat x, GLfloat y, GLfloat z,
GLfloat width, GLfloat height);
GL_API void GL_APIENTRY glDrawTexfvOES(const GLfloat * coords);
#endif /* GL_OES_draw_texture */ #endif /* GL_OES_draw_texture */
/* GL_OES_single_precision */ /* GL_OES_single_precision */
#ifndef GL_OES_single_precision #ifndef GL_OES_single_precision
#define GL_OES_single_precision 1 #define GL_OES_single_precision 1
GL_API void GL_APIENTRY glDepthRangefOES (GLclampf zNear, GLclampf zFar); GL_API void GL_APIENTRY glDepthRangefOES(GLclampf zNear, GLclampf zFar);
GL_API void GL_APIENTRY glFrustumfOES (GLfloat left, GLfloat right, GLfloat bottom, GLfloat top, GLfloat zNear, GLfloat zFar); GL_API void GL_APIENTRY glFrustumfOES(GLfloat left, GLfloat right,
GL_API void GL_APIENTRY glOrthofOES (GLfloat left, GLfloat right, GLfloat bottom, GLfloat top, GLfloat zNear, GLfloat zFar); GLfloat bottom, GLfloat top,
GL_API void GL_APIENTRY glClipPlanefOES (GLenum plane, const GLfloat *equation); GLfloat zNear, GLfloat zFar);
GL_API void GL_APIENTRY glGetClipPlanefOES (GLenum pname, GLfloat eqn[4]); GL_API void GL_APIENTRY glOrthofOES(GLfloat left, GLfloat right,
GL_API void GL_APIENTRY glClearDepthfOES (GLclampf depth); GLfloat bottom, GLfloat top,
GLfloat zNear, GLfloat zFar);
GL_API void GL_APIENTRY glClipPlanefOES(GLenum plane,
const GLfloat * equation);
GL_API void GL_APIENTRY glGetClipPlanefOES(GLenum pname, GLfloat eqn[4]);
GL_API void GL_APIENTRY glClearDepthfOES(GLclampf depth);
#endif /* GL_OES_single_precision */ #endif /* GL_OES_single_precision */
/* GL_OES_vertex_buffer_object */ /* GL_OES_vertex_buffer_object */
...@@ -1012,8 +1022,10 @@ extern "C" ...@@ -1012,8 +1022,10 @@ extern "C"
GL_API void APIENTRY glDeleteBuffersOES(GLsizei, const GLuint *); GL_API void APIENTRY glDeleteBuffersOES(GLsizei, const GLuint *);
GL_API void APIENTRY glGenBuffersOES(GLsizei, GLuint *); GL_API void APIENTRY glGenBuffersOES(GLsizei, GLuint *);
GL_API GLboolean APIENTRY glIsBufferOES(GLuint); GL_API GLboolean APIENTRY glIsBufferOES(GLuint);
GL_API void APIENTRY glBufferDataOES(GLenum, GLsizeiptr, const GLvoid *, GLenum); GL_API void APIENTRY glBufferDataOES(GLenum, GLsizeiptr, const GLvoid *,
GL_API void APIENTRY glBufferSubDataOES(GLenum, GLintptr, GLsizeiptr, const GLvoid *); GLenum);
GL_API void APIENTRY glBufferSubDataOES(GLenum, GLintptr, GLsizeiptr,
const GLvoid *);
GL_API void APIENTRY glGetBufferParameterivOES(GLenum, GLenum, GLint *); GL_API void APIENTRY glGetBufferParameterivOES(GLenum, GLenum, GLint *);
#endif /* GL_OES_vertex_buffer_object */ #endif /* GL_OES_vertex_buffer_object */
......
...@@ -477,7 +477,8 @@ SDL_RunAudio(void *devicep) ...@@ -477,7 +477,8 @@ SDL_RunAudio(void *devicep)
/* Wait for an audio buffer to become available */ /* Wait for an audio buffer to become available */
current_audio.impl.WaitDevice(device); current_audio.impl.WaitDevice(device);
} else { } else {
SDL_Delay((device->spec.samples * 1000) / device->spec.freq); SDL_Delay((device->spec.samples * 1000) /
device->spec.freq);
} }
} }
......
This diff is collapsed.
...@@ -44,7 +44,7 @@ struct SDL_PrivateAudioData ...@@ -44,7 +44,7 @@ struct SDL_PrivateAudioData
/* The audio device handle */ /* The audio device handle */
int cardno; int cardno;
int deviceno; int deviceno;
snd_pcm_t* audio_handle; snd_pcm_t *audio_handle;
/* The audio file descriptor */ /* The audio file descriptor */
int audio_fd; int audio_fd;
...@@ -53,7 +53,7 @@ struct SDL_PrivateAudioData ...@@ -53,7 +53,7 @@ struct SDL_PrivateAudioData
uint32_t timeout_on_wait; uint32_t timeout_on_wait;
/* Raw mixing buffer */ /* Raw mixing buffer */
Uint8* pcm_buf; Uint8 *pcm_buf;
Uint32 pcm_len; Uint32 pcm_len;
}; };
......
...@@ -34,7 +34,8 @@ ...@@ -34,7 +34,8 @@
/* Empty function stub to get OpenGL ES 1.0 support without */ /* Empty function stub to get OpenGL ES 1.0 support without */
/* OpenGL ES extension GL_OES_draw_texture_supported */ /* OpenGL ES extension GL_OES_draw_texture_supported */
GL_API void GL_APIENTRY glDrawTexiOES(GLint x, GLint y, GLint z, GLint width, GLint height) GL_API void GL_APIENTRY
glDrawTexiOES(GLint x, GLint y, GLint z, GLint width, GLint height)
{ {
return; return;
} }
...@@ -105,8 +106,7 @@ SDL_RenderDriver GL_ES_RenderDriver = { ...@@ -105,8 +106,7 @@ SDL_RenderDriver GL_ES_RenderDriver = {
{ {
/* OpenGL ES 1.x supported formats list */ /* OpenGL ES 1.x supported formats list */
SDL_PIXELFORMAT_BGR24, SDL_PIXELFORMAT_BGR24,
SDL_PIXELFORMAT_ABGR8888 SDL_PIXELFORMAT_ABGR8888},
},
0, 0,
0} 0}
}; };
...@@ -351,7 +351,7 @@ power_of_2(int input) ...@@ -351,7 +351,7 @@ power_of_2(int input)
} }
static int static int
GLES_CreateTexture(SDL_Renderer *renderer, SDL_Texture *texture) GLES_CreateTexture(SDL_Renderer * renderer, SDL_Texture * texture)
{ {
GLES_RenderData *renderdata = (GLES_RenderData *) renderer->driverdata; GLES_RenderData *renderdata = (GLES_RenderData *) renderer->driverdata;
SDL_Window *window = SDL_GetWindowFromID(renderer->window); SDL_Window *window = SDL_GetWindowFromID(renderer->window);
...@@ -533,8 +533,8 @@ GLES_SetTextureScaleMode(SDL_Renderer * renderer, SDL_Texture * texture) ...@@ -533,8 +533,8 @@ GLES_SetTextureScaleMode(SDL_Renderer * renderer, SDL_Texture * texture)
} }
static int static int
GLES_UpdateTexture(SDL_Renderer *renderer, SDL_Texture *texture, GLES_UpdateTexture(SDL_Renderer * renderer, SDL_Texture * texture,
const SDL_Rect *rect, const void *pixels, int pitch) const SDL_Rect * rect, const void *pixels, int pitch)
{ {
GLES_RenderData *renderdata = (GLES_RenderData *) renderer->driverdata; GLES_RenderData *renderdata = (GLES_RenderData *) renderer->driverdata;
GLES_TextureData *data = (GLES_TextureData *) texture->driverdata; GLES_TextureData *data = (GLES_TextureData *) texture->driverdata;
...@@ -858,7 +858,7 @@ GLES_RenderCopy(SDL_Renderer * renderer, SDL_Texture * texture, ...@@ -858,7 +858,7 @@ GLES_RenderCopy(SDL_Renderer * renderer, SDL_Texture * texture,
} }
static void static void
GLES_RenderPresent(SDL_Renderer *renderer) GLES_RenderPresent(SDL_Renderer * renderer)
{ {
SDL_GL_SwapWindow(renderer->window); SDL_GL_SwapWindow(renderer->window);
} }
......
...@@ -1496,8 +1496,7 @@ SDL_CreateRenderer(SDL_WindowID windowID, int index, Uint32 flags) ...@@ -1496,8 +1496,7 @@ SDL_CreateRenderer(SDL_WindowID windowID, int index, Uint32 flags)
window->renderer = SDL_CurrentDisplay.render_drivers[index] window->renderer = SDL_CurrentDisplay.render_drivers[index]
.CreateRenderer(window, flags); .CreateRenderer(window, flags);
if (window->renderer==NULL) if (window->renderer == NULL) {
{
/* Assuming renderer set its error */ /* Assuming renderer set its error */
return -1; return -1;
} }
...@@ -2719,7 +2718,7 @@ SDL_GL_GetAttribute(SDL_GLattr attr, int *value) ...@@ -2719,7 +2718,7 @@ SDL_GL_GetAttribute(SDL_GLattr attr, int *value)
{ {
#if SDL_VIDEO_OPENGL || SDL_VIDEO_OPENGL_ES #if SDL_VIDEO_OPENGL || SDL_VIDEO_OPENGL_ES
void (APIENTRY * glGetIntegervFunc) (GLenum pname, GLint * params); void (APIENTRY * glGetIntegervFunc) (GLenum pname, GLint * params);
GLenum (APIENTRY * glGetErrorFunc) (void); GLenum(APIENTRY * glGetErrorFunc) (void);
GLenum attrib = 0; GLenum attrib = 0;
GLenum error = 0; GLenum error = 0;
...@@ -2734,7 +2733,7 @@ SDL_GL_GetAttribute(SDL_GLattr attr, int *value) ...@@ -2734,7 +2733,7 @@ SDL_GL_GetAttribute(SDL_GLattr attr, int *value)
} }
/* Clear value in any case */ /* Clear value in any case */
*value=0; *value = 0;
switch (attr) { switch (attr) {
case SDL_GL_RETAINED_BACKING: case SDL_GL_RETAINED_BACKING:
...@@ -2842,11 +2841,9 @@ SDL_GL_GetAttribute(SDL_GLattr attr, int *value) ...@@ -2842,11 +2841,9 @@ SDL_GL_GetAttribute(SDL_GLattr attr, int *value)
} }
glGetIntegervFunc(attrib, (GLint *) value); glGetIntegervFunc(attrib, (GLint *) value);
error=glGetErrorFunc(); error = glGetErrorFunc();
if (error!=GL_NO_ERROR) if (error != GL_NO_ERROR) {
{ switch (error) {
switch (error)
{
case GL_INVALID_ENUM: case GL_INVALID_ENUM:
{ {
SDL_SetError("OpenGL error: GL_INVALID_ENUM"); SDL_SetError("OpenGL error: GL_INVALID_ENUM");
......
...@@ -107,8 +107,14 @@ typedef struct ...@@ -107,8 +107,14 @@ typedef struct
{ NDSTX_BG, NDSTX_SPR } type; /* represented in a bg or sprite. */ { NDSTX_BG, NDSTX_SPR } type; /* represented in a bg or sprite. */
int hw_index; /* index of sprite in OAM or bg from libnds */ int hw_index; /* index of sprite in OAM or bg from libnds */
int pitch, bpp; /* useful information about the texture */ int pitch, bpp; /* useful information about the texture */
struct { int x,y; } scale; /* x/y stretch (24.8 fixed point) */ struct
struct { int x,y; } scroll; /* x/y offset */ {
int x, y;
} scale; /* x/y stretch (24.8 fixed point) */
struct
{
int x, y;
} scroll; /* x/y offset */
int rotate; /* -32768 to 32767, texture rotation */ int rotate; /* -32768 to 32767, texture rotation */
u16 *vram_pixels; /* where the pixel data is stored (a pointer into VRAM) */ u16 *vram_pixels; /* where the pixel data is stored (a pointer into VRAM) */
u16 *vram_palette; /* where the palette data is stored if it's indexed. */ u16 *vram_palette; /* where the palette data is stored if it's indexed. */
...@@ -310,7 +316,8 @@ NDS_CreateTexture(SDL_Renderer * renderer, SDL_Texture * texture) ...@@ -310,7 +316,8 @@ NDS_CreateTexture(SDL_Renderer * renderer, SDL_Texture * texture)
txdat->dim.vdy = 0x100; txdat->dim.vdy = 0x100;
txdat->dim.pitch = pitch; txdat->dim.pitch = pitch;
txdat->dim.bpp = bpp; txdat->dim.bpp = bpp;
txdat->vram_pixels = (u16 *) (data->sub ? SPRITE_GFX_SUB : SPRITE_GFX); txdat->vram_pixels =
(u16 *) (data->sub ? SPRITE_GFX_SUB : SPRITE_GFX);
/* FIXME: use tileIdx*boundary /* FIXME: use tileIdx*boundary
to point to proper location */ to point to proper location */
} else { } else {
...@@ -332,20 +339,26 @@ NDS_CreateTexture(SDL_Renderer * renderer, SDL_Texture * texture) ...@@ -332,20 +339,26 @@ NDS_CreateTexture(SDL_Renderer * renderer, SDL_Texture * texture)
SDL_OutOfMemory(); SDL_OutOfMemory();
return -1; return -1;
} }
// hard-coded for 256x256 for now... // hard-coded for 256x256 for now...
// TODO: a series of if-elseif-else's to find the closest but larger size. // TODO: a series of if-elseif-else's to find the closest but larger size.
if(!data->sub) { if (!data->sub) {
if(bpp==8) { if (bpp == 8) {
txdat->hw_index = bgInit(whichbg, BgType_Bmp8, BgSize_B8_256x256, 0, 0); txdat->hw_index =
bgInit(whichbg, BgType_Bmp8, BgSize_B8_256x256, 0, 0);
} else { } else {
txdat->hw_index = bgInit(whichbg, BgType_Bmp16, BgSize_B16_256x256, 0, 0); txdat->hw_index =
bgInit(whichbg, BgType_Bmp16, BgSize_B16_256x256, 0,
0);
} }
} else { } else {
if(bpp==8) { if (bpp == 8) {
txdat->hw_index = bgInitSub(whichbg, BgType_Bmp8, BgSize_B8_256x256, 0, 0); txdat->hw_index =
bgInitSub(whichbg, BgType_Bmp8, BgSize_B8_256x256, 0,
0);
} else { } else {
txdat->hw_index = bgInitSub(whichbg, BgType_Bmp16, BgSize_B16_256x256, 0, 0); txdat->hw_index =
bgInitSub(whichbg, BgType_Bmp16, BgSize_B16_256x256,
0, 0);
} }
} }
...@@ -357,14 +370,14 @@ NDS_CreateTexture(SDL_Renderer * renderer, SDL_Texture * texture) ...@@ -357,14 +370,14 @@ NDS_CreateTexture(SDL_Renderer * renderer, SDL_Texture * texture)
bgUpdate(bg3); bgUpdate(bg3);
*/ */
txdat->type = NDSTX_BG; txdat->type = NDSTX_BG;
txdat->pitch = (texture->w)*(bpp/8); txdat->pitch = (texture->w) * (bpp / 8);
txdat->bpp = bpp; txdat->bpp = bpp;
txdat->rotate = 0; txdat->rotate = 0;
txdat->scale.x = 0x100; txdat->scale.x = 0x100;
txdat->scale.y = 0x100; txdat->scale.y = 0x100;
txdat->scroll.x = 0; txdat->scroll.x = 0;
txdat->scroll.y = 0; txdat->scroll.y = 0;
txdat->vram_pixels = (u16*)bgGetGfxPtr(txdat->hw_index); txdat->vram_pixels = (u16 *) bgGetGfxPtr(txdat->hw_index);
bgSetCenter(txdat->hw_index, 0, 0); bgSetCenter(txdat->hw_index, 0, 0);
bgSetRotateScale(txdat->hw_index, txdat->rotate, txdat->scale.x, bgSetRotateScale(txdat->hw_index, txdat->rotate, txdat->scale.x,
......
This source diff could not be displayed because it is too large. You can view the blob instead.
...@@ -29,8 +29,8 @@ ...@@ -29,8 +29,8 @@
/* GF headers must be included first for the Photon GF functions */ /* GF headers must be included first for the Photon GF functions */
#if defined(SDL_VIDEO_OPENGL_ES) #if defined(SDL_VIDEO_OPENGL_ES)
#include <gf/gf.h> #include <gf/gf.h>
#include <GLES/egl.h> #include <GLES/egl.h>
#endif /* SDL_VIDEO_OPENGL_ES */ #endif /* SDL_VIDEO_OPENGL_ES */
#include "SDL_config.h" #include "SDL_config.h"
...@@ -48,14 +48,14 @@ typedef struct SDL_VideoData ...@@ -48,14 +48,14 @@ typedef struct SDL_VideoData
PhRid_t rid[SDL_VIDEO_PHOTON_MAX_RIDS]; PhRid_t rid[SDL_VIDEO_PHOTON_MAX_RIDS];
uint32_t avail_rids; uint32_t avail_rids;
uint32_t current_device_id; uint32_t current_device_id;
#if defined(SDL_VIDEO_OPENGL_ES) #if defined(SDL_VIDEO_OPENGL_ES)
gf_dev_t gfdev; /* GF device handle */ gf_dev_t gfdev; /* GF device handle */
gf_dev_info_t gfdev_info; /* GF device information */ gf_dev_info_t gfdev_info; /* GF device information */
SDL_bool gfinitialized; /* GF device initialization status */ SDL_bool gfinitialized; /* GF device initialization status */
EGLDisplay egldisplay; /* OpenGL ES display connection */ EGLDisplay egldisplay; /* OpenGL ES display connection */
uint32_t egl_refcount; /* OpenGL ES reference count */ uint32_t egl_refcount; /* OpenGL ES reference count */
uint32_t swapinterval; /* OpenGL ES default swap interval */ uint32_t swapinterval; /* OpenGL ES default swap interval */
#endif /* SDL_VIDEO_OPENGL_ES */ #endif /* SDL_VIDEO_OPENGL_ES */
} SDL_VideoData; } SDL_VideoData;
/* This is hardcoded value in photon/Pg.h */ /* This is hardcoded value in photon/Pg.h */
...@@ -73,13 +73,13 @@ typedef struct SDL_DisplayData ...@@ -73,13 +73,13 @@ typedef struct SDL_DisplayData
uint8_t description[SDL_VIDEO_PHOTON_DEVICENAME_MAX]; uint8_t description[SDL_VIDEO_PHOTON_DEVICENAME_MAX];
/* Device description */ /* Device description */
uint32_t caps; /* Device capabilities */ uint32_t caps; /* Device capabilities */
PhCursorDef_t* cursor; /* Global cursor settings */ PhCursorDef_t *cursor; /* Global cursor settings */
SDL_bool cursor_visible; /* SDL_TRUE if cursor visible */ SDL_bool cursor_visible; /* SDL_TRUE if cursor visible */
uint32_t cursor_size; /* Cursor size in memory w/ structure */ uint32_t cursor_size; /* Cursor size in memory w/ structure */
#if defined(SDL_VIDEO_OPENGL_ES) #if defined(SDL_VIDEO_OPENGL_ES)
gf_display_t display; /* GF display handle */ gf_display_t display; /* GF display handle */
gf_display_info_t display_info; /* GF display information */ gf_display_info_t display_info; /* GF display information */
#endif /* SDL_VIDEO_OPENGL_ES */ #endif /* SDL_VIDEO_OPENGL_ES */
} SDL_DisplayData; } SDL_DisplayData;
/* Maximum amount of OpenGL ES framebuffer configurations */ /* Maximum amount of OpenGL ES framebuffer configurations */
...@@ -87,9 +87,9 @@ typedef struct SDL_DisplayData ...@@ -87,9 +87,9 @@ typedef struct SDL_DisplayData
typedef struct SDL_WindowData typedef struct SDL_WindowData
{ {
SDL_bool uses_gles; /* if true window must support OpenGL ES*/ SDL_bool uses_gles; /* if true window must support OpenGL ES */
PtWidget_t* window; /* window handle */ PtWidget_t *window; /* window handle */
#if defined(SDL_VIDEO_OPENGL_ES) #if defined(SDL_VIDEO_OPENGL_ES)
EGLConfig gles_configs[SDL_VIDEO_GF_OPENGLES_CONFS]; EGLConfig gles_configs[SDL_VIDEO_GF_OPENGLES_CONFS];
/* OpenGL ES framebuffer confs */ /* OpenGL ES framebuffer confs */
EGLint gles_config; /* OpenGL ES configuration index */ EGLint gles_config; /* OpenGL ES configuration index */
...@@ -97,8 +97,8 @@ typedef struct SDL_WindowData ...@@ -97,8 +97,8 @@ typedef struct SDL_WindowData
EGLint gles_attributes[256]; /* OpenGL ES attributes for context */ EGLint gles_attributes[256]; /* OpenGL ES attributes for context */
EGLSurface gles_surface; /* OpenGL ES target rendering surface */ EGLSurface gles_surface; /* OpenGL ES target rendering surface */
gf_surface_t gfsurface; /* OpenGL ES GF's surface */ gf_surface_t gfsurface; /* OpenGL ES GF's surface */
PdOffscreenContext_t* phsurface; /* OpenGL ES Photon's surface */ PdOffscreenContext_t *phsurface; /* OpenGL ES Photon's surface */
#endif /* SDL_VIDEO_OPENGL_ES */ #endif /* SDL_VIDEO_OPENGL_ES */
} SDL_WindowData; } SDL_WindowData;
/****************************************************************************/ /****************************************************************************/
...@@ -106,7 +106,7 @@ typedef struct SDL_WindowData ...@@ -106,7 +106,7 @@ typedef struct SDL_WindowData
/****************************************************************************/ /****************************************************************************/
typedef struct Photon_DeviceCaps typedef struct Photon_DeviceCaps
{ {
uint8_t* name; uint8_t *name;
uint32_t caps; uint32_t caps;
} Photon_DeviceCaps; } Photon_DeviceCaps;
...@@ -123,38 +123,39 @@ typedef struct Photon_DeviceCaps ...@@ -123,38 +123,39 @@ typedef struct Photon_DeviceCaps
int photon_videoinit(_THIS); int photon_videoinit(_THIS);
void photon_videoquit(_THIS); void photon_videoquit(_THIS);
void photon_getdisplaymodes(_THIS); void photon_getdisplaymodes(_THIS);
int photon_setdisplaymode(_THIS, SDL_DisplayMode* mode); int photon_setdisplaymode(_THIS, SDL_DisplayMode * mode);
int photon_setdisplaypalette(_THIS, SDL_Palette* palette); int photon_setdisplaypalette(_THIS, SDL_Palette * palette);
int photon_getdisplaypalette(_THIS, SDL_Palette* palette); int photon_getdisplaypalette(_THIS, SDL_Palette * palette);
int photon_setdisplaygammaramp(_THIS, Uint16* ramp); int photon_setdisplaygammaramp(_THIS, Uint16 * ramp);
int photon_getdisplaygammaramp(_THIS, Uint16* ramp); int photon_getdisplaygammaramp(_THIS, Uint16 * ramp);
int photon_createwindow(_THIS, SDL_Window* window); int photon_createwindow(_THIS, SDL_Window * window);
int photon_createwindowfrom(_THIS, SDL_Window* window, const void* data); int photon_createwindowfrom(_THIS, SDL_Window * window, const void *data);
void photon_setwindowtitle(_THIS, SDL_Window* window); void photon_setwindowtitle(_THIS, SDL_Window * window);
void photon_setwindowicon(_THIS, SDL_Window* window, SDL_Surface* icon); void photon_setwindowicon(_THIS, SDL_Window * window, SDL_Surface * icon);
void photon_setwindowposition(_THIS, SDL_Window* window); void photon_setwindowposition(_THIS, SDL_Window * window);
void photon_setwindowsize(_THIS, SDL_Window* window); void photon_setwindowsize(_THIS, SDL_Window * window);
void photon_showwindow(_THIS, SDL_Window* window); void photon_showwindow(_THIS, SDL_Window * window);
void photon_hidewindow(_THIS, SDL_Window* window); void photon_hidewindow(_THIS, SDL_Window * window);
void photon_raisewindow(_THIS, SDL_Window* window); void photon_raisewindow(_THIS, SDL_Window * window);
void photon_maximizewindow(_THIS, SDL_Window* window); void photon_maximizewindow(_THIS, SDL_Window * window);
void photon_minimizewindow(_THIS, SDL_Window* window); void photon_minimizewindow(_THIS, SDL_Window * window);
void photon_restorewindow(_THIS, SDL_Window* window); void photon_restorewindow(_THIS, SDL_Window * window);
void photon_setwindowgrab(_THIS, SDL_Window* window); void photon_setwindowgrab(_THIS, SDL_Window * window);
void photon_destroywindow(_THIS, SDL_Window* window); void photon_destroywindow(_THIS, SDL_Window * window);
/* Window manager function */ /* Window manager function */
SDL_bool photon_getwindowwminfo(_THIS, SDL_Window* window, struct SDL_SysWMinfo* info); SDL_bool photon_getwindowwminfo(_THIS, SDL_Window * window,
struct SDL_SysWMinfo *info);
/* OpenGL/OpenGL ES functions */ /* OpenGL/OpenGL ES functions */
int photon_gl_loadlibrary(_THIS, const char* path); int photon_gl_loadlibrary(_THIS, const char *path);
void* photon_gl_getprocaddres(_THIS, const char* proc); void *photon_gl_getprocaddres(_THIS, const char *proc);
void photon_gl_unloadlibrary(_THIS); void photon_gl_unloadlibrary(_THIS);
SDL_GLContext photon_gl_createcontext(_THIS, SDL_Window* window); SDL_GLContext photon_gl_createcontext(_THIS, SDL_Window * window);
int photon_gl_makecurrent(_THIS, SDL_Window* window, SDL_GLContext context); int photon_gl_makecurrent(_THIS, SDL_Window * window, SDL_GLContext context);
int photon_gl_setswapinterval(_THIS, int interval); int photon_gl_setswapinterval(_THIS, int interval);
int photon_gl_getswapinterval(_THIS); int photon_gl_getswapinterval(_THIS);
void photon_gl_swapwindow(_THIS, SDL_Window* window); void photon_gl_swapwindow(_THIS, SDL_Window * window);
void photon_gl_deletecontext(_THIS, SDL_GLContext context); void photon_gl_deletecontext(_THIS, SDL_GLContext context);
/* Event handling function */ /* Event handling function */
......
This diff is collapsed.
...@@ -35,7 +35,7 @@ ...@@ -35,7 +35,7 @@
typedef struct SDL_MouseData typedef struct SDL_MouseData
{ {
SDL_DisplayData* didata; SDL_DisplayData *didata;
} SDL_MouseData; } SDL_MouseData;
int32_t photon_addinputdevices(_THIS); int32_t photon_addinputdevices(_THIS);
......
...@@ -106,7 +106,9 @@ ...@@ -106,7 +106,9 @@
#define PHOTON_SCANCODE_PRNSCR 0x54 /* only key pressed event, no release */ #define PHOTON_SCANCODE_PRNSCR 0x54 /* only key pressed event, no release */
#define PHOTON_SCANCODE_SCROLLLOCK 0x46 #define PHOTON_SCANCODE_SCROLLLOCK 0x46
/* #define PHOTON_SCANCODE_PAUSE 0x?? */ /* pause doesn't generates a scancode */ #if 0 /* pause doesn't generates a scancode */
#define PHOTON_SCANCODE_PAUSE 0x??
#endif
#define PHOTON_SCANCODE_INSERT 0x52 #define PHOTON_SCANCODE_INSERT 0x52
#define PHOTON_SCANCODE_HOME 0x47 #define PHOTON_SCANCODE_HOME 0x47
#define PHOTON_SCANCODE_PAGEUP 0x49 #define PHOTON_SCANCODE_PAGEUP 0x49
......
...@@ -26,10 +26,10 @@ ...@@ -26,10 +26,10 @@
#include "SDL_photon_pixelfmt.h" #include "SDL_photon_pixelfmt.h"
uint32_t photon_bits_to_sdl_pixelformat(uint32_t pixelfmt) uint32_t
photon_bits_to_sdl_pixelformat(uint32_t pixelfmt)
{ {
switch(pixelfmt) switch (pixelfmt) {
{
case 8: case 8:
{ {
return SDL_PIXELFORMAT_INDEX8; return SDL_PIXELFORMAT_INDEX8;
...@@ -58,10 +58,10 @@ uint32_t photon_bits_to_sdl_pixelformat(uint32_t pixelfmt) ...@@ -58,10 +58,10 @@ uint32_t photon_bits_to_sdl_pixelformat(uint32_t pixelfmt)
} }
} }
uint32_t photon_sdl_to_bits_pixelformat(uint32_t pixelfmt) uint32_t
photon_sdl_to_bits_pixelformat(uint32_t pixelfmt)
{ {
switch(pixelfmt) switch (pixelfmt) {
{
case SDL_PIXELFORMAT_INDEX8: case SDL_PIXELFORMAT_INDEX8:
{ {
return 8; return 8;
...@@ -122,10 +122,10 @@ uint32_t photon_sdl_to_bits_pixelformat(uint32_t pixelfmt) ...@@ -122,10 +122,10 @@ uint32_t photon_sdl_to_bits_pixelformat(uint32_t pixelfmt)
return 0; return 0;
} }
uint32_t photon_image_to_sdl_pixelformat(uint32_t pixelfmt) uint32_t
photon_image_to_sdl_pixelformat(uint32_t pixelfmt)
{ {
switch(pixelfmt) switch (pixelfmt) {
{
case Pg_IMAGE_PALETTE_BYTE: case Pg_IMAGE_PALETTE_BYTE:
{ {
return SDL_PIXELFORMAT_INDEX8; return SDL_PIXELFORMAT_INDEX8;
...@@ -161,10 +161,10 @@ uint32_t photon_image_to_sdl_pixelformat(uint32_t pixelfmt) ...@@ -161,10 +161,10 @@ uint32_t photon_image_to_sdl_pixelformat(uint32_t pixelfmt)
return 0; return 0;
} }
uint32_t photon_sdl_to_image_pixelformat(uint32_t pixelfmt) uint32_t
photon_sdl_to_image_pixelformat(uint32_t pixelfmt)
{ {
switch(pixelfmt) switch (pixelfmt) {
{
case SDL_PIXELFORMAT_INDEX8: case SDL_PIXELFORMAT_INDEX8:
{ {
return Pg_IMAGE_PALETTE_BYTE; return Pg_IMAGE_PALETTE_BYTE;
......
This diff is collapsed.
...@@ -35,7 +35,7 @@ ...@@ -35,7 +35,7 @@
typedef struct SDL_RenderData typedef struct SDL_RenderData
{ {
SDL_Window* window; /* SDL window type */ SDL_Window *window; /* SDL window type */
SDL_bool enable_vsync; /* VSYNC flip synchronization enable */ SDL_bool enable_vsync; /* VSYNC flip synchronization enable */
uint32_t surface_visible_idx; /* Index of visible surface */ uint32_t surface_visible_idx; /* Index of visible surface */
uint32_t surface_render_idx; /* Index of render surface */ uint32_t surface_render_idx; /* Index of render surface */
......
This diff is collapsed.
...@@ -42,7 +42,7 @@ ...@@ -42,7 +42,7 @@
typedef struct SDL_MouseData typedef struct SDL_MouseData
{ {
SDL_DisplayData* didata; SDL_DisplayData *didata;
} SDL_MouseData; } SDL_MouseData;
int32_t gf_addinputdevices(_THIS); int32_t gf_addinputdevices(_THIS);
...@@ -90,29 +90,29 @@ typedef struct _hidd_local_item ...@@ -90,29 +90,29 @@ typedef struct _hidd_local_item
uint16_t type; uint16_t type;
uint8_t reserved[2]; uint8_t reserved[2];
uint32_t value; uint32_t value;
struct _hidd_local_item* next_local; struct _hidd_local_item *next_local;
struct _hidd_local_item* alt_local; struct _hidd_local_item *alt_local;
} hidd_local_item_t; } hidd_local_item_t;
typedef struct _hidd_local_table typedef struct _hidd_local_table
{ {
hidd_local_item_t* usage_info; hidd_local_item_t *usage_info;
hidd_local_item_t* designator_info; hidd_local_item_t *designator_info;
hidd_local_item_t* string_info; hidd_local_item_t *string_info;
uint8_t delimiter; uint8_t delimiter;
uint8_t reserved[3]; uint8_t reserved[3];
} hidd_local_table_t; } hidd_local_table_t;
typedef struct _hidd_field typedef struct _hidd_field
{ {
struct hidd_report_instance* report; struct hidd_report_instance *report;
struct hidd_collection* collection; struct hidd_collection *collection;
uint16_t report_offset; uint16_t report_offset;
uint16_t flags; uint16_t flags;
hidd_global_item_t gitem; hidd_global_item_t gitem;
hidd_local_table_t* ltable; hidd_local_table_t *ltable;
struct _hidd_field* next_field; struct _hidd_field *next_field;
void* user; void *user;
} hidd_field_t; } hidd_field_t;
typedef struct hidd_report_instance typedef struct hidd_report_instance
...@@ -120,30 +120,30 @@ typedef struct hidd_report_instance ...@@ -120,30 +120,30 @@ typedef struct hidd_report_instance
uint8_t report_id; uint8_t report_id;
uint8_t reserved[1]; uint8_t reserved[1];
uint16_t report_type; uint16_t report_type;
hidd_field_t* field; hidd_field_t *field;
uint16_t num_field; uint16_t num_field;
uint16_t byte_len; uint16_t byte_len;
uint16_t bit_len; uint16_t bit_len;
uint8_t reserved2[2]; uint8_t reserved2[2];
struct hidd_collection* collection; struct hidd_collection *collection;
struct hidd_report_instance* next_col_report; struct hidd_report_instance *next_col_report;
struct hidd_report_instance* next_report; struct hidd_report_instance *next_report;
} hidd_report_instance_t; } hidd_report_instance_t;
typedef struct hidd_report typedef struct hidd_report
{ {
TAILQ_ENTRY(hidd_report) link; TAILQ_ENTRY(hidd_report) link;
hidd_report_instance_t* rinst; hidd_report_instance_t *rinst;
hidd_device_instance_t* dev_inst; hidd_device_instance_t *dev_inst;
uint32_t flags; uint32_t flags;
struct hidd_connection* connection; struct hidd_connection *connection;
void* user; void *user;
} hidd_report_t; } hidd_report_t;
typedef struct hidview_device typedef struct hidview_device
{ {
struct hidd_report_instance* instance; struct hidd_report_instance *instance;
struct hidd_report* report; struct hidd_report *report;
} hidview_device_t; } hidview_device_t;
/*****************************************************************************/ /*****************************************************************************/
......
...@@ -30,21 +30,25 @@ ...@@ -30,21 +30,25 @@
/* This is OpenGL ES 1.0 helper functions from OpenGL ES 1.1 specification, */ /* This is OpenGL ES 1.0 helper functions from OpenGL ES 1.1 specification, */
/* which could be implemented independently from hardware, just wrappers */ /* which could be implemented independently from hardware, just wrappers */
GLAPI void APIENTRY glTexParameteri(GLenum target, GLenum pname, GLint param) GLAPI void APIENTRY
glTexParameteri(GLenum target, GLenum pname, GLint param)
{ {
glTexParameterx(target, pname, (GLfixed)param); glTexParameterx(target, pname, (GLfixed) param);
return; return;
} }
GLAPI void APIENTRY glTexParameteriv(GLenum target, GLenum pname, const GLint* params) GLAPI void APIENTRY
glTexParameteriv(GLenum target, GLenum pname, const GLint * params)
{ {
/* Retrieve one parameter only */ /* Retrieve one parameter only */
glTexParameterx(target, pname, (GLfixed)*params); glTexParameterx(target, pname, (GLfixed) * params);
return; return;
} }
GLAPI void APIENTRY glColor4ub(GLubyte red, GLubyte green, GLubyte blue, GLubyte alpha) GLAPI void APIENTRY
glColor4ub(GLubyte red, GLubyte green, GLubyte blue, GLubyte alpha)
{ {
glColor4f(((GLfloat)red)/255.f, ((GLfloat)green)/255.f, ((GLfloat)blue)/255.f, ((GLfloat)alpha)/255.f); glColor4f(((GLfloat) red) / 255.f, ((GLfloat) green) / 255.f,
((GLfloat) blue) / 255.f, ((GLfloat) alpha) / 255.f);
return; return;
} }
...@@ -31,7 +31,9 @@ ...@@ -31,7 +31,9 @@
#include <GLES/glext.h> #include <GLES/glext.h>
GLAPI void APIENTRY glTexParameteri(GLenum target, GLenum pname, GLint param); GLAPI void APIENTRY glTexParameteri(GLenum target, GLenum pname, GLint param);
GLAPI void APIENTRY glTexParameteriv(GLenum target, GLenum pname, const GLint* params); GLAPI void APIENTRY glTexParameteriv(GLenum target, GLenum pname,
GLAPI void APIENTRY glColor4ub(GLubyte red, GLubyte green, GLubyte blue, GLubyte alpha); const GLint * params);
GLAPI void APIENTRY glColor4ub(GLubyte red, GLubyte green, GLubyte blue,
GLubyte alpha);
#endif /* __SDL_GF_OPENGLES_H__ */ #endif /* __SDL_GF_OPENGLES_H__ */
...@@ -27,10 +27,10 @@ ...@@ -27,10 +27,10 @@
#include "SDL_config.h" #include "SDL_config.h"
#include "SDL_gf_pixelfmt.h" #include "SDL_gf_pixelfmt.h"
gf_format_t qnxgf_sdl_to_gf_pixelformat(uint32_t pixelfmt) gf_format_t
qnxgf_sdl_to_gf_pixelformat(uint32_t pixelfmt)
{ {
switch(pixelfmt) switch (pixelfmt) {
{
case SDL_PIXELFORMAT_INDEX8: case SDL_PIXELFORMAT_INDEX8:
{ {
return GF_FORMAT_PAL8; return GF_FORMAT_PAL8;
...@@ -91,10 +91,10 @@ gf_format_t qnxgf_sdl_to_gf_pixelformat(uint32_t pixelfmt) ...@@ -91,10 +91,10 @@ gf_format_t qnxgf_sdl_to_gf_pixelformat(uint32_t pixelfmt)
return GF_FORMAT_INVALID; return GF_FORMAT_INVALID;
} }
uint32_t qnxgf_gf_to_sdl_pixelformat(gf_format_t pixelfmt) uint32_t
qnxgf_gf_to_sdl_pixelformat(gf_format_t pixelfmt)
{ {
switch(pixelfmt) switch (pixelfmt) {
{
case GF_FORMAT_PAL8: case GF_FORMAT_PAL8:
{ {
return SDL_PIXELFORMAT_INDEX8; return SDL_PIXELFORMAT_INDEX8;
......
This diff is collapsed.
...@@ -35,7 +35,7 @@ ...@@ -35,7 +35,7 @@
typedef struct SDL_RenderData typedef struct SDL_RenderData
{ {
SDL_Window* window; /* SDL window type */ SDL_Window *window; /* SDL window type */
SDL_bool enable_vsync; /* VSYNC flip synchronization enable */ SDL_bool enable_vsync; /* VSYNC flip synchronization enable */
gf_surface_t surface[SDL_GF_MAX_SURFACES]; /* Surface handles */ gf_surface_t surface[SDL_GF_MAX_SURFACES]; /* Surface handles */
gf_surface_info_t surface_info[SDL_GF_MAX_SURFACES]; /* Surface info */ gf_surface_info_t surface_info[SDL_GF_MAX_SURFACES]; /* Surface info */
......
This diff is collapsed.
...@@ -33,7 +33,7 @@ ...@@ -33,7 +33,7 @@
#include <gf/gf3d.h> #include <gf/gf3d.h>
#if defined(SDL_VIDEO_OPENGL_ES) #if defined(SDL_VIDEO_OPENGL_ES)
#include <GLES/egl.h> #include <GLES/egl.h>
#endif /* SDL_VIDEO_OPENGL_ES */ #endif /* SDL_VIDEO_OPENGL_ES */
typedef struct SDL_VideoData typedef struct SDL_VideoData
...@@ -41,11 +41,11 @@ typedef struct SDL_VideoData ...@@ -41,11 +41,11 @@ typedef struct SDL_VideoData
gf_dev_t gfdev; /* GF device handle */ gf_dev_t gfdev; /* GF device handle */
gf_dev_info_t gfdev_info; /* GF device information */ gf_dev_info_t gfdev_info; /* GF device information */
SDL_bool gfinitialized; /* GF device initialization status */ SDL_bool gfinitialized; /* GF device initialization status */
#if defined(SDL_VIDEO_OPENGL_ES) #if defined(SDL_VIDEO_OPENGL_ES)
EGLDisplay egldisplay; /* OpenGL ES display connection */ EGLDisplay egldisplay; /* OpenGL ES display connection */
uint32_t egl_refcount; /* OpenGL ES reference count */ uint32_t egl_refcount; /* OpenGL ES reference count */
uint32_t swapinterval; /* OpenGL ES default swap interval */ uint32_t swapinterval; /* OpenGL ES default swap interval */
#endif /* SDL_VIDEO_OPENGL_ES */ #endif /* SDL_VIDEO_OPENGL_ES */
} SDL_VideoData; } SDL_VideoData;
#define SDL_VIDEO_GF_DEVICENAME_MAX 257 #define SDL_VIDEO_GF_DEVICENAME_MAX 257
...@@ -73,7 +73,7 @@ typedef struct SDL_DisplayData ...@@ -73,7 +73,7 @@ typedef struct SDL_DisplayData
typedef struct SDL_WindowData typedef struct SDL_WindowData
{ {
SDL_bool uses_gles; /* true if window support OpenGL ES */ SDL_bool uses_gles; /* true if window support OpenGL ES */
#if defined(SDL_VIDEO_OPENGL_ES) #if defined(SDL_VIDEO_OPENGL_ES)
gf_3d_target_t target; /* OpenGL ES window target */ gf_3d_target_t target; /* OpenGL ES window target */
SDL_bool target_created; /* GF 3D target is created if true */ SDL_bool target_created; /* GF 3D target is created if true */
EGLConfig gles_configs[SDL_VIDEO_GF_OPENGLES_CONFS]; EGLConfig gles_configs[SDL_VIDEO_GF_OPENGLES_CONFS];
...@@ -82,13 +82,13 @@ typedef struct SDL_WindowData ...@@ -82,13 +82,13 @@ typedef struct SDL_WindowData
EGLContext gles_context; /* OpenGL ES context */ EGLContext gles_context; /* OpenGL ES context */
EGLint gles_attributes[256]; /* OpenGL ES attributes for context */ EGLint gles_attributes[256]; /* OpenGL ES attributes for context */
EGLSurface gles_surface; /* OpenGL ES target rendering surface */ EGLSurface gles_surface; /* OpenGL ES target rendering surface */
#endif /* SDL_VIDEO_OPENGL_ES */ #endif /* SDL_VIDEO_OPENGL_ES */
} SDL_WindowData; } SDL_WindowData;
typedef struct SDL_GLDriverData typedef struct SDL_GLDriverData
{ {
#if defined(SDL_VIDEO_OPENGL_ES) #if defined(SDL_VIDEO_OPENGL_ES)
#endif /* SDL_VIDEO_OPENGL_ES */ #endif /* SDL_VIDEO_OPENGL_ES */
} SDL_GLDriverData; } SDL_GLDriverData;
/****************************************************************************/ /****************************************************************************/
...@@ -96,7 +96,7 @@ typedef struct SDL_GLDriverData ...@@ -96,7 +96,7 @@ typedef struct SDL_GLDriverData
/****************************************************************************/ /****************************************************************************/
typedef struct GF_DeviceCaps typedef struct GF_DeviceCaps
{ {
uint8_t* name; uint8_t *name;
uint32_t caps; uint32_t caps;
} GF_DeviceCaps; } GF_DeviceCaps;
...@@ -117,38 +117,39 @@ typedef struct GF_DeviceCaps ...@@ -117,38 +117,39 @@ typedef struct GF_DeviceCaps
int qnxgf_videoinit(_THIS); int qnxgf_videoinit(_THIS);
void qnxgf_videoquit(_THIS); void qnxgf_videoquit(_THIS);
void qnxgf_getdisplaymodes(_THIS); void qnxgf_getdisplaymodes(_THIS);
int qnxgf_setdisplaymode(_THIS, SDL_DisplayMode* mode); int qnxgf_setdisplaymode(_THIS, SDL_DisplayMode * mode);
int qnxgf_setdisplaypalette(_THIS, SDL_Palette* palette); int qnxgf_setdisplaypalette(_THIS, SDL_Palette * palette);
int qnxgf_getdisplaypalette(_THIS, SDL_Palette* palette); int qnxgf_getdisplaypalette(_THIS, SDL_Palette * palette);
int qnxgf_setdisplaygammaramp(_THIS, Uint16* ramp); int qnxgf_setdisplaygammaramp(_THIS, Uint16 * ramp);
int qnxgf_getdisplaygammaramp(_THIS, Uint16* ramp); int qnxgf_getdisplaygammaramp(_THIS, Uint16 * ramp);
int qnxgf_createwindow(_THIS, SDL_Window* window); int qnxgf_createwindow(_THIS, SDL_Window * window);
int qnxgf_createwindowfrom(_THIS, SDL_Window* window, const void* data); int qnxgf_createwindowfrom(_THIS, SDL_Window * window, const void *data);
void qnxgf_setwindowtitle(_THIS, SDL_Window* window); void qnxgf_setwindowtitle(_THIS, SDL_Window * window);
void qnxgf_setwindowicon(_THIS, SDL_Window* window, SDL_Surface* icon); void qnxgf_setwindowicon(_THIS, SDL_Window * window, SDL_Surface * icon);
void qnxgf_setwindowposition(_THIS, SDL_Window* window); void qnxgf_setwindowposition(_THIS, SDL_Window * window);
void qnxgf_setwindowsize(_THIS, SDL_Window* window); void qnxgf_setwindowsize(_THIS, SDL_Window * window);
void qnxgf_showwindow(_THIS, SDL_Window* window); void qnxgf_showwindow(_THIS, SDL_Window * window);
void qnxgf_hidewindow(_THIS, SDL_Window* window); void qnxgf_hidewindow(_THIS, SDL_Window * window);
void qnxgf_raisewindow(_THIS, SDL_Window* window); void qnxgf_raisewindow(_THIS, SDL_Window * window);
void qnxgf_maximizewindow(_THIS, SDL_Window* window); void qnxgf_maximizewindow(_THIS, SDL_Window * window);
void qnxgf_minimizewindow(_THIS, SDL_Window* window); void qnxgf_minimizewindow(_THIS, SDL_Window * window);
void qnxgf_restorewindow(_THIS, SDL_Window* window); void qnxgf_restorewindow(_THIS, SDL_Window * window);
void qnxgf_setwindowgrab(_THIS, SDL_Window* window); void qnxgf_setwindowgrab(_THIS, SDL_Window * window);
void qnxgf_destroywindow(_THIS, SDL_Window* window); void qnxgf_destroywindow(_THIS, SDL_Window * window);
/* Window manager function */ /* Window manager function */
SDL_bool qnxgf_getwindowwminfo(_THIS, SDL_Window* window, struct SDL_SysWMinfo* info); SDL_bool qnxgf_getwindowwminfo(_THIS, SDL_Window * window,
struct SDL_SysWMinfo *info);
/* OpenGL/OpenGL ES functions */ /* OpenGL/OpenGL ES functions */
int qnxgf_gl_loadlibrary(_THIS, const char* path); int qnxgf_gl_loadlibrary(_THIS, const char *path);
void* qnxgf_gl_getprocaddres(_THIS, const char* proc); void *qnxgf_gl_getprocaddres(_THIS, const char *proc);
void qnxgf_gl_unloadlibrary(_THIS); void qnxgf_gl_unloadlibrary(_THIS);
SDL_GLContext qnxgf_gl_createcontext(_THIS, SDL_Window* window); SDL_GLContext qnxgf_gl_createcontext(_THIS, SDL_Window * window);
int qnxgf_gl_makecurrent(_THIS, SDL_Window* window, SDL_GLContext context); int qnxgf_gl_makecurrent(_THIS, SDL_Window * window, SDL_GLContext context);
int qnxgf_gl_setswapinterval(_THIS, int interval); int qnxgf_gl_setswapinterval(_THIS, int interval);
int qnxgf_gl_getswapinterval(_THIS); int qnxgf_gl_getswapinterval(_THIS);
void qnxgf_gl_swapwindow(_THIS, SDL_Window* window); void qnxgf_gl_swapwindow(_THIS, SDL_Window * window);
void qnxgf_gl_deletecontext(_THIS, SDL_GLContext context); void qnxgf_gl_deletecontext(_THIS, SDL_GLContext context);
/* Event handling function */ /* Event handling function */
......
...@@ -598,7 +598,7 @@ WIN_WindowProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) ...@@ -598,7 +598,7 @@ WIN_WindowProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
case WM_NCPAINT: case WM_NCPAINT:
{ {
if (SDL_GetWindowFlags(data->windowID) & SDL_WINDOW_FOREIGN) { if (SDL_GetWindowFlags(data->windowID) & SDL_WINDOW_FOREIGN) {
return(0); return (0);
} }
break; break;
} }
......
...@@ -56,7 +56,7 @@ WIN_GetDisplayMode(LPCTSTR deviceName, DWORD index, SDL_DisplayMode * mode) ...@@ -56,7 +56,7 @@ WIN_GetDisplayMode(LPCTSTR deviceName, DWORD index, SDL_DisplayMode * mode)
#ifdef _WIN32_WCE #ifdef _WIN32_WCE
/* In WinCE EnumDisplaySettings(ENUM_CURRENT_SETTINGS) doesn't take the user defined orientation /* In WinCE EnumDisplaySettings(ENUM_CURRENT_SETTINGS) doesn't take the user defined orientation
into account but GetSystemMetrixs does. */ into account but GetSystemMetrixs does. */
if(index == ENUM_CURRENT_SETTINGS) { if (index == ENUM_CURRENT_SETTINGS) {
mode->w = GetSystemMetrics(SM_CXSCREEN); mode->w = GetSystemMetrics(SM_CXSCREEN);
mode->h = GetSystemMetrics(SM_CYSCREEN); mode->h = GetSystemMetrics(SM_CYSCREEN);
} }
...@@ -216,7 +216,7 @@ WIN_SetDisplayMode(_THIS, SDL_DisplayMode * mode) ...@@ -216,7 +216,7 @@ WIN_SetDisplayMode(_THIS, SDL_DisplayMode * mode)
/* TODO: implement correctly. /* TODO: implement correctly.
On my Asus MyPAL, if I execute the code below On my Asus MyPAL, if I execute the code below
I get DISP_CHANGE_BADFLAGS and the Titlebar of the fullscreen window stays I get DISP_CHANGE_BADFLAGS and the Titlebar of the fullscreen window stays
visible ... (SDL_RaiseWindow() would fix that one)*/ visible ... (SDL_RaiseWindow() would fix that one) */
return 0; return 0;
#endif #endif
......
...@@ -40,7 +40,11 @@ ...@@ -40,7 +40,11 @@
#define WGL_CONTEXT_FORWARD_COMPATIBLE_BIT_ARB 0x0002 #define WGL_CONTEXT_FORWARD_COMPATIBLE_BIT_ARB 0x0002
#endif #endif
typedef HGLRC (APIENTRYP PFNWGLCREATECONTEXTATTRIBSARBPROC) (HDC hDC, HGLRC hShareContext, const int * attribList); typedef HGLRC(APIENTRYP PFNWGLCREATECONTEXTATTRIBSARBPROC) (HDC hDC,
HGLRC
hShareContext,
const int
*attribList);
int int
WIN_GL_LoadLibrary(_THIS, const char *path) WIN_GL_LoadLibrary(_THIS, const char *path)
...@@ -512,7 +516,9 @@ WIN_GL_CreateContext(_THIS, SDL_Window * window) ...@@ -512,7 +516,9 @@ WIN_GL_CreateContext(_THIS, SDL_Window * window)
return NULL; return NULL;
} }
wglCreateContextAttribsARB = (PFNWGLCREATECONTEXTATTRIBSARBPROC) _this->gl_data->wglGetProcAddress("wglCreateContextAttribsARB"); wglCreateContextAttribsARB =
(PFNWGLCREATECONTEXTATTRIBSARBPROC) _this->gl_data->
wglGetProcAddress("wglCreateContextAttribsARB");
if (!wglCreateContextAttribsARB) { if (!wglCreateContextAttribsARB) {
SDL_SetError("GL 3.x is not supported"); SDL_SetError("GL 3.x is not supported");
context = temp_context; context = temp_context;
......
...@@ -242,7 +242,6 @@ WIN_CreateWindow(_THIS, SDL_Window * window) ...@@ -242,7 +242,6 @@ WIN_CreateWindow(_THIS, SDL_Window * window)
} }
g_hCtx[window->id] = videodata->WTOpenA(hwnd, &lc, TRUE); g_hCtx[window->id] = videodata->WTOpenA(hwnd, &lc, TRUE);
} }
#ifndef _WIN32_WCE /* has no RawInput */ #ifndef _WIN32_WCE /* has no RawInput */
/* we're telling the window, we want it to report raw input events from mice */ /* we're telling the window, we want it to report raw input events from mice */
Rid.usUsagePage = 0x01; Rid.usUsagePage = 0x01;
......
This diff is collapsed.
...@@ -118,10 +118,10 @@ main(int argc, char *argv[]) ...@@ -118,10 +118,10 @@ main(int argc, char *argv[])
/* you may want to change these according to the platform */ /* you may want to change these according to the platform */
video_w = 320; video_w = 320;
video_h = 480; video_h = 480;
#ifdef __QNXNTO__ #ifdef __QNXNTO__
video_h = 640; video_h = 640;
video_w = 480; video_w = 480;
#endif /* __QNXNTO__ */ #endif /* __QNXNTO__ */
if (argv[1]) { if (argv[1]) {
gl_library = argv[1]; gl_library = argv[1];
...@@ -153,11 +153,11 @@ main(int argc, char *argv[]) ...@@ -153,11 +153,11 @@ main(int argc, char *argv[])
pixels[3 * i + 2] = rand() % 250 - 125; pixels[3 * i + 2] = rand() % 250 - 125;
} }
#ifdef __QNXNTO__ #ifdef __QNXNTO__
f.glViewport(0, 0, video_h, video_w); f.glViewport(0, 0, video_h, video_w);
#else #else
f.glViewport(0, 0, video_w, video_h); f.glViewport(0, 0, video_w, video_h);
#endif /* __QNXNTO__ */ #endif /* __QNXNTO__ */
f.glMatrixMode(GL_PROJECTION); f.glMatrixMode(GL_PROJECTION);
f.glLoadIdentity(); f.glLoadIdentity();
......
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment