Skip to content
This repository has been archived by the owner on Oct 24, 2019. It is now read-only.

Commit

Permalink
Still can't manage to get a correct screen resolution
Browse files Browse the repository at this point in the history
  • Loading branch information
reefab committed Jul 1, 2012
1 parent d158ae1 commit b6f602c
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 12 deletions.
9 changes: 9 additions & 0 deletions src/client/cl_main.c
Expand Up @@ -27,6 +27,11 @@

#include "header/client.h"

#if defined(PI)
#include "bcm_host.h"
#endif


void CL_ForwardToServer_f (void);
void CL_Changing_f (void);
void CL_Reconnect_f (void);
Expand Down Expand Up @@ -780,6 +785,10 @@ void CL_Frame (int msec)

void CL_Init (void)
{
#if defined(PI)
printf("Init PI BCM system\n");
bcm_host_init();
#endif
if (dedicated->value)
return; /* nothing running on the client */

Expand Down
21 changes: 17 additions & 4 deletions src/egl/eglport.c
Expand Up @@ -53,7 +53,7 @@ int fbdev = -1;
#include "GLES2/gl2.h"
#include "EGL/egl.h"
#include "EGL/eglext.h"

static EGL_DISPMANX_WINDOW_T nativewindow;
#endif

int8_t VSync = 0;
Expand Down Expand Up @@ -96,7 +96,12 @@ void EGL_Close()
g_eglContext = NULL;
g_eglDisplay = NULL;

#if defined(USE_EGL_RAW)
#if defined(PI)
/* if (nativewindow != NULL) { */
/* free(nativewindow); */
/* } */
/* nativewindow = NULL; */
#elif defined(USE_EGL_RAW)
if (g_Window != NULL) {
free(g_Window);
}
Expand Down Expand Up @@ -124,6 +129,7 @@ int8_t EGL_Init( void )
{
int configIndex = 0;


if (FindAppropriateEGLConfigs() != 0)
{
printf( "EGL ERROR: Unable to configure EGL. See previous error.\n" );
Expand Down Expand Up @@ -258,7 +264,11 @@ int8_t ConfigureEGL(EGLConfig config)
#endif /* defined(USE_EGL_SDL) */

printf( "EGL Creating Context\n" );
#if defined(PI)
g_eglContext = peglCreateContext( g_eglDisplay, config, EGL_NO_CONTEXT, s_contextAttribs );
#else
g_eglContext = peglCreateContext( g_eglDisplay, config, NULL, s_contextAttribs );
#endif

if (g_eglContext == EGL_NO_CONTEXT)
{
Expand Down Expand Up @@ -296,7 +306,6 @@ int8_t ConfigureEGL(EGLConfig config)
#endif /* defined(USE_EGL_RAW) */

#if defined(PI)
static EGL_DISPMANX_WINDOW_T nativewindow;

DISPMANX_ELEMENT_HANDLE_T dispman_element;
DISPMANX_DISPLAY_HANDLE_T dispman_display;
Expand All @@ -319,6 +328,7 @@ int8_t ConfigureEGL(EGLConfig config)
// You can hardcode the resolution here:
/* display_width = 1440; */
/* display_height = 900; */
printf("Current PI display size: %dx%d\n", display_width, display_height);

dst_rect.x = 0;
dst_rect.y = 0;
Expand Down Expand Up @@ -387,7 +397,6 @@ int8_t FindAppropriateEGLConfigs( void )
EGLint ConfigAttribs[19];

#if defined(PI)

ConfigAttribs[attrib++] = EGL_RED_SIZE;
ConfigAttribs[attrib++] = 8;
ConfigAttribs[attrib++] = EGL_GREEN_SIZE;
Expand Down Expand Up @@ -429,7 +438,11 @@ int8_t FindAppropriateEGLConfigs( void )
ConfigAttribs[attrib++] = EGL_NONE;
#endif /* defined(PI) */

#if defined(PI)
result = eglSaneChooseConfigBRCM( g_eglDisplay, ConfigAttribs, g_allConfigs, 1, &g_totalConfigsFound );
#else
result = peglChooseConfig( g_eglDisplay, ConfigAttribs, g_allConfigs, g_totalConfigsIn, &g_totalConfigsFound );
#endif
if (result != EGL_TRUE || g_totalConfigsFound == 0)
{
CheckEGLErrors( __FILE__, __LINE__ );
Expand Down
8 changes: 1 addition & 7 deletions src/refresh/r_main.c
Expand Up @@ -24,10 +24,6 @@
* =======================================================================
*/

#if defined(PI)
#include "bcm_host.h"
#endif

#include "header/local.h"

#define NUM_BEAM_SEGS 6
Expand Down Expand Up @@ -1300,9 +1296,7 @@ R_SetMode ( void )
int
R_Init ( void *hinstance, void *hWnd )
{
#if defined(PI)
bcm_host_init();
#endif

char renderer_buffer [ 1000 ];
char vendor_buffer [ 1000 ];
int err;
Expand Down
2 changes: 1 addition & 1 deletion src/sdl/input.c
Expand Up @@ -290,7 +290,7 @@ void IN_Update(void)

IN_Update_Flag = 1;

#if defined(WIZ) || defined(CAANOO) || defined(PI)
#if defined(WIZ) || defined(CAANOO)
uint32_t key;
uint8_t update;
uint8_t button;
Expand Down

0 comments on commit b6f602c

Please sign in to comment.