src/video/riscos/SDL_riscostask.c
changeset 1035 974ba6ae0fa3
parent 955 d74fbf56f2f6
child 1059 de22ea8440d2
equal deleted inserted replaced
1034:2eca15c3f609 1035:974ba6ae0fa3
    19     Sam Lantinga
    19     Sam Lantinga
    20     slouken@devolution.com
    20     slouken@devolution.com
    21 */
    21 */
    22 
    22 
    23 /*
    23 /*
    24     This file added by Alan Buckley (alan_baa@hotmail.com) to support RISCOS 
    24     This file added by Alan Buckley (alan_baa@hotmail.com) to support RISC OS 
    25 	26 March 2003
    25 	26 March 2003
    26 
    26 
    27 	File includes routines for:
    27 	File includes routines for:
    28 	  Setting up as a WIMP Task
    28 	  Setting up as a WIMP Task
    29 	  Reading information about the current desktop
    29 	  Reading information about the current desktop
    42 #ifndef DISABLE_THREADS
    42 #ifndef DISABLE_THREADS
    43 #include <pthread.h>
    43 #include <pthread.h>
    44 pthread_t main_thread;
    44 pthread_t main_thread;
    45 #endif
    45 #endif
    46 
    46 
    47 /* RISCOS variables */
    47 /* RISC OS variables */
    48 
    48 
    49 static int task_handle = 0;
    49 static int task_handle = 0;
    50 static int wimp_version = 0;
    50 static int wimp_version = 0;
    51 
    51 
    52 /* RISC OS variables to help compatability with certain programs */
    52 /* RISC OS variables to help compatability with certain programs */
    82 }
    82 }
    83 #endif
    83 #endif
    84 
    84 
    85 /******************************************************************
    85 /******************************************************************
    86 
    86 
    87  Initialise as RISCOS Wimp task
    87  Initialise as RISC OS Wimp task
    88 
    88 
    89 *******************************************************************/
    89 *******************************************************************/
    90 
    90 
    91 int RISCOS_InitTask()
    91 int RISCOS_InitTask()
    92 {
    92 {
   167 
   167 
   168 		   Finally once this value has been retrieved use it unless
   168 		   Finally once this value has been retrieved use it unless
   169 		   there is a variable set up in the form SDL$<name>$TaskName
   169 		   there is a variable set up in the form SDL$<name>$TaskName
   170 		   in which case the value of this variable will be used.
   170 		   in which case the value of this variable will be used.
   171 
   171 
   172 		   Now also gets other riscos configuration varibles
   172 		   Now also gets other RISC OS configuration varibles
   173                 SDL$<name>$BackBuffer - set to 1 to use a system memory backbuffer in fullscreen mode
   173                 SDL$<name>$BackBuffer - set to 1 to use a system memory backbuffer in fullscreen mode
   174 						    so updates wait until a call to SDL_UpdateRects. (default 0)
   174 						    so updates wait until a call to SDL_UpdateRects. (default 0)
   175 						    This is required for programmes where they have assumed this is
   175 						    This is required for programmes where they have assumed this is
   176 						    always the case which is contrary to the documentation.
   176 						    always the case which is contrary to the documentation.
   177                SDL$<name>$CloseAction
   177                SDL$<name>$CloseAction
   224           p++; /* Move over the < */
   224           p++; /* Move over the < */
   225        }
   225        }
   226 
   226 
   227 	   if (*p)
   227 	   if (*p)
   228 	   {
   228 	   {
   229 		   /* Read variables that effect the RISCOS SDL engine for this task */
   229 		   /* Read variables that effect the RISC OS SDL engine for this task */
   230 		   env_var = malloc(strlen(p) + 18); /* 18 is larger than the biggest variable name */
   230 		   env_var = malloc(strlen(p) + 18); /* 18 is larger than the biggest variable name */
   231 		   if (env_var)
   231 		   if (env_var)
   232 		   {
   232 		   {
   233 			   char *env_val;
   233 			   char *env_val;
   234 
   234 
   244 			   strcpy(env_var, "SDL$");
   244 			   strcpy(env_var, "SDL$");
   245 			   strcat(env_var, p);
   245 			   strcat(env_var, p);
   246 			   strcat(env_var, "$BackBuffer");
   246 			   strcat(env_var, "$BackBuffer");
   247 
   247 
   248 			   env_val = getenv(env_var);
   248 			   env_val = getenv(env_var);
   249 			   if (env_val && strcmp(env_val,"1") == 0) riscos_backbuffer = 1;
   249 			   if (env_val) riscos_backbuffer = atoi(env_val);
   250 
   250 
   251 			   strcpy(env_var, "SDL$");
   251 			   strcpy(env_var, "SDL$");
   252 			   strcat(env_var, p);
   252 			   strcat(env_var, p);
   253 			   strcat(env_var, "$CloseAction");
   253 			   strcat(env_var, "$CloseAction");
   254 
   254