mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-02 09:52:27 -04:00
Modified glGsg to support Pointer Textures
This commit is contained in:
parent
52d9b08b81
commit
61bb918380
@ -121,13 +121,19 @@ null_glBlendColor(GLclampf, GLclampf, GLclampf, GLclampf) {
|
|||||||
CPT(Shader::ShaderFile) default_shader_name = new Shader::ShaderFile("default-shader");
|
CPT(Shader::ShaderFile) default_shader_name = new Shader::ShaderFile("default-shader");
|
||||||
CPT(Shader::ShaderFile) default_shader_body = new Shader::ShaderFile("\
|
CPT(Shader::ShaderFile) default_shader_body = new Shader::ShaderFile("\
|
||||||
uniform mediump mat4 p3d_ModelViewProjectionMatrix;\
|
uniform mediump mat4 p3d_ModelViewProjectionMatrix;\
|
||||||
attribute highp vec4 p3d_Vertex;\
|
attribute highp vec4 p3d_Vertex;\
|
||||||
void main(void) {\
|
|
||||||
gl_Position = p3d_ModelViewProjectionMatrix * p3d_Vertex;\
}\n",
|
void main(void) {\
|
||||||
"void main(void) {\
|
|
||||||
gl_FragColor = vec4(1.0, 0.0, 0.0, 1.0);\
|
gl_Position = p3d_ModelViewProjectionMatrix * p3d_Vertex;\
|
||||||
|
}\n",
|
||||||
|
"void main(void) {\
|
||||||
|
|
||||||
|
gl_FragColor = vec4(1.0, 0.0, 0.0, 1.0);\
|
||||||
|
|
||||||
}\n");
|
}\n");
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////
|
||||||
// Function: uchar_bgr_to_rgb
|
// Function: uchar_bgr_to_rgb
|
||||||
@ -8449,13 +8455,19 @@ upload_texture_image(CLP(TextureContext) *gtc,
|
|||||||
}
|
}
|
||||||
|
|
||||||
for (int n = mipmap_bias; n < num_ram_mipmap_levels; ++n) {
|
for (int n = mipmap_bias; n < num_ram_mipmap_levels; ++n) {
|
||||||
const unsigned char *image_ptr = tex->get_ram_mipmap_image(n);
|
// we grab the mipmap pointer first, if it is NULL we grab the
|
||||||
|
// normal mipmap image pointer which is a PTA_uchar
|
||||||
|
const unsigned char *image_ptr = (unsigned char*)tex->get_ram_mipmap_pointer(n);
|
||||||
if (image_ptr == (const unsigned char *)NULL) {
|
if (image_ptr == (const unsigned char *)NULL) {
|
||||||
GLCAT.warning()
|
CPTA_uchar ptimage = tex->get_ram_mipmap_image(n);
|
||||||
<< "No mipmap level " << n << " defined for " << tex->get_name()
|
if (ptimage == (const unsigned char *)NULL) {
|
||||||
<< "\n";
|
GLCAT.warning()
|
||||||
// No mipmap level n; stop here.
|
<< "No mipmap level " << n << " defined for " << tex->get_name()
|
||||||
break;
|
<< "\n";
|
||||||
|
// No mipmap level n; stop here.
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
image_ptr = ptimage;
|
||||||
}
|
}
|
||||||
|
|
||||||
size_t image_size = tex->get_ram_mipmap_image_size(n);
|
size_t image_size = tex->get_ram_mipmap_image_size(n);
|
||||||
@ -8575,17 +8587,18 @@ upload_texture_image(CLP(TextureContext) *gtc,
|
|||||||
}
|
}
|
||||||
|
|
||||||
for (int n = mipmap_bias; n < num_ram_mipmap_levels; ++n) {
|
for (int n = mipmap_bias; n < num_ram_mipmap_levels; ++n) {
|
||||||
CPTA_uchar ptimage = tex->get_ram_mipmap_image(n);
|
const unsigned char * image_ptr = (unsigned char*)tex->get_ram_mipmap_pointer(n);
|
||||||
if (ptimage == (const unsigned char *)NULL) {
|
if (image_ptr == (const unsigned char *)NULL) {
|
||||||
if (GLCAT.is_debug()) {
|
CPTA_uchar ptimage = tex->get_ram_mipmap_image(n);
|
||||||
GLCAT.debug()
|
if (ptimage == (const unsigned char *)NULL) {
|
||||||
|
GLCAT.warning()
|
||||||
<< "No mipmap level " << n << " defined for " << tex->get_name()
|
<< "No mipmap level " << n << " defined for " << tex->get_name()
|
||||||
<< "\n";
|
<< "\n";
|
||||||
|
// No mipmap level n; stop here.
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
// No mipmap level n; stop here.
|
image_ptr = ptimage;
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
const unsigned char *image_ptr = ptimage;
|
|
||||||
|
|
||||||
size_t image_size = tex->get_ram_mipmap_image_size(n);
|
size_t image_size = tex->get_ram_mipmap_image_size(n);
|
||||||
if (one_page_only) {
|
if (one_page_only) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user