1189 else if StrPos(Str2PChar(vendor), Str2PChar('intel')) <> nil then |
1189 else if StrPos(Str2PChar(vendor), Str2PChar('intel')) <> nil then |
1190 cGPUVendor:= gvATI |
1190 cGPUVendor:= gvATI |
1191 else if StrPos(Str2PChar(vendor), Str2PChar('ati')) <> nil then |
1191 else if StrPos(Str2PChar(vendor), Str2PChar('ati')) <> nil then |
1192 cGPUVendor:= gvIntel; |
1192 cGPUVendor:= gvIntel; |
1193 //SupportNPOTT:= glLoadExtension('GL_ARB_texture_non_power_of_two'); |
1193 //SupportNPOTT:= glLoadExtension('GL_ARB_texture_non_power_of_two'); |
|
1194 |
1194 if isStereoEnabled then |
1195 if isStereoEnabled then |
1195 begin |
1196 begin |
|
1197 // prepare left and right frame buffers and associated textures |
1196 glLoadExtension('GL_EXT_framebuffer_object'); |
1198 glLoadExtension('GL_EXT_framebuffer_object'); |
|
1199 |
|
1200 // left |
1197 glGenFramebuffersEXT(1, @framel); |
1201 glGenFramebuffersEXT(1, @framel); |
1198 glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, framel); |
1202 glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, framel); |
1199 glGenRenderbuffersEXT(1, @depthl); |
1203 glGenRenderbuffersEXT(1, @depthl); |
1200 glBindRenderbufferEXT(GL_RENDERBUFFER_EXT, depthl); |
1204 glBindRenderbufferEXT(GL_RENDERBUFFER_EXT, depthl); |
1201 glRenderbufferStorageEXT(GL_RENDERBUFFER_EXT, GL_DEPTH_COMPONENT, cScreenWidth, cScreenHeight); |
1205 glRenderbufferStorageEXT(GL_RENDERBUFFER_EXT, GL_DEPTH_COMPONENT, cScreenWidth, cScreenHeight); |
1205 glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA8, cScreenWidth, cScreenHeight, 0, GL_RGBA, GL_UNSIGNED_BYTE, nil); |
1209 glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA8, cScreenWidth, cScreenHeight, 0, GL_RGBA, GL_UNSIGNED_BYTE, nil); |
1206 glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); |
1210 glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); |
1207 glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); |
1211 glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); |
1208 glFramebufferTexture2DEXT(GL_FRAMEBUFFER_EXT, GL_COLOR_ATTACHMENT0_EXT, GL_TEXTURE_2D, texl, 0); |
1212 glFramebufferTexture2DEXT(GL_FRAMEBUFFER_EXT, GL_COLOR_ATTACHMENT0_EXT, GL_TEXTURE_2D, texl, 0); |
1209 |
1213 |
|
1214 // right |
1210 glGenFramebuffersEXT(1, @framer); |
1215 glGenFramebuffersEXT(1, @framer); |
1211 glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, framer); |
1216 glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, framer); |
1212 glGenRenderbuffersEXT(1, @depthr); |
1217 glGenRenderbuffersEXT(1, @depthr); |
1213 glBindRenderbufferEXT(GL_RENDERBUFFER_EXT, depthr); |
1218 glBindRenderbufferEXT(GL_RENDERBUFFER_EXT, depthr); |
1214 glRenderbufferStorageEXT(GL_RENDERBUFFER_EXT, GL_DEPTH_COMPONENT, cScreenWidth, cScreenHeight); |
1219 glRenderbufferStorageEXT(GL_RENDERBUFFER_EXT, GL_DEPTH_COMPONENT, cScreenWidth, cScreenHeight); |
1218 glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA8, cScreenWidth, cScreenHeight, 0, GL_RGBA, GL_UNSIGNED_BYTE, nil); |
1223 glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA8, cScreenWidth, cScreenHeight, 0, GL_RGBA, GL_UNSIGNED_BYTE, nil); |
1219 glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); |
1224 glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); |
1220 glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); |
1225 glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); |
1221 glFramebufferTexture2DEXT(GL_FRAMEBUFFER_EXT, GL_COLOR_ATTACHMENT0_EXT, GL_TEXTURE_2D, texr, 0); |
1226 glFramebufferTexture2DEXT(GL_FRAMEBUFFER_EXT, GL_COLOR_ATTACHMENT0_EXT, GL_TEXTURE_2D, texr, 0); |
1222 |
1227 |
|
1228 // reset |
1223 glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, 0) |
1229 glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, 0) |
1224 end; |
1230 end; |
1225 {$ENDIF} |
1231 {$ENDIF} |
1226 |
1232 |
1227 {$IFDEF DEBUGFILE} |
1233 {$IFDEF DEBUGFILE} |