qboolean vid_supportrefreshrate = false;
-cvar_t vid_soft = {CVAR_SAVE, "vid_soft", "0", "enables use of the DarkPlaces Software Rasterizer rather than OpenGL or Direct3D"};
-cvar_t vid_soft_threads = {CVAR_SAVE, "vid_soft_threads", "2", "the number of threads the DarkPlaces Software Rasterizer should use"};
-cvar_t vid_soft_interlace = {CVAR_SAVE, "vid_soft_interlace", "1", "whether the DarkPlaces Software Rasterizer should interlace the screen bands occupied by each thread"};
cvar_t joy_detected = {CVAR_READONLY, "joy_detected", "0", "number of joysticks detected by engine"};
cvar_t joy_enable = {CVAR_SAVE, "joy_enable", "0", "enables joystick support"};
cvar_t joy_index = {0, "joy_index", "0", "selects which joystick to use if you have multiple"};
if (event.jbutton.button < 48)
Key_Event( event.jbutton.button + (event.jbutton.button < 16 ? K_JOY1 : K_AUX1 - 16), 0, (event.jbutton.state == SDL_PRESSED) );
break;
+ case SDL_JOYAXISMOTION:
+ case SDL_JOYBALLMOTION:
+ case SDL_JOYHATMOTION:
+ break;
+ case SDL_VIDEOEXPOSE:
+ break;
case SDL_VIDEORESIZE:
if(vid_resizable.integer < 2)
{
if (event.jbutton.button < 48)
Key_Event( event.jbutton.button + (event.jbutton.button < 16 ? K_JOY1 : K_AUX1 - 16), 0, (event.jbutton.state == SDL_PRESSED) );
break;
+ case SDL_JOYAXISMOTION:
+ case SDL_JOYBALLMOTION:
+ case SDL_JOYHATMOTION:
+ break;
+ case SDL_VIDEOEXPOSE:
+ break;
case SDL_WINDOWEVENT:
//if (event.window.windowID == window) // how to compare?
{
// LordHavoc: report supported extensions
Con_DPrintf("\nQuakeC extensions for server and client: %s\nQuakeC extensions for menu: %s\n", vm_sv_extensions, vm_m_extensions );
+
+ // GLES devices in general do not like GL_BGRA, so use GL_RGBA
+ vid.forcetextype = TEXTYPE_RGBA;
vid.support.gl20shaders = true;
vid.support.amd_texture_texture4 = false;
vid.support.ext_texture_compression_s3tc = false;
vid.support.ext_texture_edge_clamp = true;
vid.support.ext_texture_filter_anisotropic = false; // probably don't want to use it...
+ vid.support.ext_texture_srgb = false;
qglGetIntegerv(GL_MAX_TEXTURE_SIZE, (GLint*)&vid.maxtexturesize_2d);
if (vid.support.ext_texture_filter_anisotropic)
Cvar_RegisterVariable(&apple_mouse_noaccel);
#endif
#endif
- Cvar_RegisterVariable(&vid_soft);
- Cvar_RegisterVariable(&vid_soft_threads);
- Cvar_RegisterVariable(&vid_soft_interlace);
Cvar_RegisterVariable(&joy_detected);
Cvar_RegisterVariable(&joy_enable);
Cvar_RegisterVariable(&joy_index);
int i;
#if SETVIDEOMODE
int flags = SDL_HWSURFACE;
+ if(!COM_CheckParm("-noasyncblit")) flags |= SDL_ASYNCBLIT;
#else
int windowflags = SDL_WINDOW_SHOWN;
#endif
// enable key repeat since everyone expects it
SDL_EnableKeyRepeat(SDL_DEFAULT_REPEAT_DELAY, SDL_DEFAULT_REPEAT_INTERVAL);
- gl_platform = "SDLSoft";
- gl_platformextensions = "";
-
- gl_renderer = "DarkPlaces-Soft";
- gl_vendor = "Forest Hale";
- gl_version = "0.0";
- gl_extensions = "";
-
- // clear the extension flags
- memset(&vid.support, 0, sizeof(vid.support));
- Cvar_SetQuick(&gl_info_extensions, "");
-
- vid.forcevbo = false;
- vid.support.arb_depth_texture = true;
- vid.support.arb_draw_buffers = true;
- vid.support.arb_occlusion_query = true;
- vid.support.arb_shadow = true;
- //vid.support.arb_texture_compression = true;
- vid.support.arb_texture_cube_map = true;
- vid.support.arb_texture_non_power_of_two = false;
- vid.support.arb_vertex_buffer_object = true;
- vid.support.ext_blend_subtract = true;
- vid.support.ext_draw_range_elements = true;
- vid.support.ext_framebuffer_object = true;
- vid.support.ext_texture_3d = true;
- //vid.support.ext_texture_compression_s3tc = true;
- vid.support.ext_texture_filter_anisotropic = true;
- vid.support.ati_separate_stencil = true;
-
- vid.maxtexturesize_2d = 16384;
- vid.maxtexturesize_3d = 512;
- vid.maxtexturesize_cubemap = 16384;
- vid.texunits = 4;
- vid.teximageunits = 32;
- vid.texarrayunits = 8;
- vid.max_anisotropy = 1;
- vid.maxdrawbuffers = 4;
-
- vid.texunits = bound(4, vid.texunits, MAX_TEXTUREUNITS);
- vid.teximageunits = bound(16, vid.teximageunits, MAX_TEXTUREUNITS);
- vid.texarrayunits = bound(8, vid.texarrayunits, MAX_TEXTUREUNITS);
- Con_DPrintf("Using DarkPlaces Software Rasterizer rendering path\n");
- vid.renderpath = RENDERPATH_SOFT;
- vid.useinterleavedarrays = false;
-
- Cvar_SetQuick(&gl_info_vendor, gl_vendor);
- Cvar_SetQuick(&gl_info_renderer, gl_renderer);
- Cvar_SetQuick(&gl_info_version, gl_version);
- Cvar_SetQuick(&gl_info_platform, gl_platform ? gl_platform : "");
- Cvar_SetQuick(&gl_info_driver, gl_driver);
-
- // LordHavoc: report supported extensions
- Con_DPrintf("\nQuakeC extensions for server and client: %s\nQuakeC extensions for menu: %s\n", vm_sv_extensions, vm_m_extensions );
-
- // clear to black (loading plaque will be seen over this)
- GL_Clear(GL_COLOR_BUFFER_BIT, NULL, 1.0f, 128);
+ VID_Soft_SharedSetup();
vid_numjoysticks = SDL_NumJoysticks();
vid_numjoysticks = bound(0, vid_numjoysticks, MAX_JOYSTICKS);
{
if (!SDL_WasInit(SDL_INIT_VIDEO) && SDL_InitSubSystem(SDL_INIT_VIDEO) < 0)
Sys_Error ("Failed to init SDL video subsystem: %s", SDL_GetError());
-#ifdef SSE2_PRESENT
+#ifdef SSE_POSSIBLE
if (vid_soft.integer)
return VID_InitModeSoft(mode);
else
case RENDERPATH_GLES2:
CHECKGLERROR
if (r_speeds.integer == 2 || gl_finish.integer)
- {
- qglFinish();CHECKGLERROR
- }
+ GL_Finish();
#if SDL_MAJOR_VERSION == 1 && SDL_MINOR_VERSION == 2
#else
{
case RENDERPATH_SOFT:
DPSOFTRAST_Finish();
#if SETVIDEOMODE
+// if (!r_test.integer)
+ {
SDL_BlitSurface(vid_softsurface, NULL, screen, NULL);
SDL_Flip(screen);
+ }
#else
{
SDL_Surface *screen = SDL_GetWindowSurface(window);
case RENDERPATH_D3D9:
case RENDERPATH_D3D10:
case RENDERPATH_D3D11:
+ if (r_speeds.integer == 2 || gl_finish.integer)
+ GL_Finish();
break;
}
}
int bpp = SDL_GetVideoInfo()->vfmt->BitsPerPixel;
k = 0;
- for(vidmodes = SDL_ListModes(NULL, SDL_FULLSCREEN|SDL_HWSURFACE); *vidmodes; ++vidmodes)
+ for(vidmodes = SDL_ListModes(NULL, SDL_FULLSCREEN|SDL_HWSURFACE); vidmodes && *vidmodes; ++vidmodes)
{
if(k >= maxcount)
break;