* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
+ * THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
* AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
#include "glxheader.h"
#include "xmesaP.h"
+#include "main/api_exec.h"
#include "main/context.h"
#include "main/extensions.h"
#include "main/framebuffer.h"
#include "main/macros.h"
#include "main/renderbuffer.h"
#include "main/teximage.h"
+#include "main/version.h"
+#include "main/vtxfmt.h"
#include "glapi/glthread.h"
#include "swrast/swrast.h"
#include "swrast/s_renderbuffer.h"
/* Create a temporary XImage */
img = XCreateImage( dpy, visinfo->visual, visinfo->depth,
ZPixmap, 0, /*format, offset*/
- (char*) MALLOC(8), /*data*/
+ malloc(8), /*data*/
1, 1, /*width, height*/
32, /*bitmap_pad*/
0 /*bytes_per_line*/
b->frontxrb->drawable = d;
b->frontxrb->pixmap = (XMesaPixmap) d;
_mesa_add_renderbuffer(&b->mesa_buffer, BUFFER_FRONT_LEFT,
- &b->frontxrb->Base);
+ &b->frontxrb->Base.Base);
/*
* Back renderbuffer
b->db_mode = vis->ximage_flag ? BACK_XIMAGE : BACK_PIXMAP;
_mesa_add_renderbuffer(&b->mesa_buffer, BUFFER_BACK_LEFT,
- &b->backxrb->Base);
+ &b->backxrb->Base.Base);
}
/*
}
if (b && window) {
- char *data;
-
/* Do window-specific initializations */
/* these should have been set in create_xmesa_buffer */
GCGraphicsExposures, &gcvalues);
}
XMesaSetFunction( v->display, b->swapgc, GXcopy );
-
- /* Initialize the row buffer XImage for use in write_color_span() */
- data = (char*) MALLOC(MAX_WIDTH*4);
- b->rowimage = XCreateImage( v->display,
- v->visinfo->visual,
- v->visinfo->depth,
- ZPixmap, 0, /*format, offset*/
- data, /*data*/
- MAX_WIDTH, 1, /*width, height*/
- 32, /*bitmap_pad*/
- 0 /*bytes_per_line*/ );
- if (!b->rowimage)
- return GL_FALSE;
}
return GL_TRUE;
* the struct but we may need some of the information contained in it
* at a later time.
*/
- v->visinfo = (XVisualInfo *) MALLOC(sizeof(*visinfo));
+ v->visinfo = (XVisualInfo *) malloc(sizeof(*visinfo));
if(!v->visinfo) {
free(v);
return NULL;
alpha_bits = v->mesa_visual.alphaBits;
}
- _mesa_initialize_visual( &v->mesa_visual,
- db_flag, stereo_flag,
- red_bits, green_bits,
- blue_bits, alpha_bits,
- depth_size,
- stencil_size,
- accum_red_size, accum_green_size,
- accum_blue_size, accum_alpha_size,
- 0 );
+ if (!_mesa_initialize_visual(&v->mesa_visual,
+ db_flag, stereo_flag,
+ red_bits, green_bits,
+ blue_bits, alpha_bits,
+ depth_size,
+ stencil_size,
+ accum_red_size, accum_green_size,
+ accum_blue_size, accum_alpha_size,
+ 0)) {
+ FREE(v);
+ return NULL;
+ }
/* XXX minor hack */
v->mesa_visual.level = level;
/* initialize with default driver functions, then plug in XMesa funcs */
_mesa_init_driver_functions(&functions);
xmesa_init_driver_functions(v, &functions);
- if (!_mesa_initialize_context(mesaCtx, API_OPENGL, &v->mesa_visual,
+ if (!_mesa_initialize_context(mesaCtx, API_OPENGL_COMPAT, &v->mesa_visual,
share_list ? &(share_list->mesa) : (struct gl_context *) NULL,
- &functions, (void *) c)) {
+ &functions)) {
free(c);
return NULL;
}
_mesa_enable_1_5_extensions(mesaCtx);
_mesa_enable_2_0_extensions(mesaCtx);
_mesa_enable_2_1_extensions(mesaCtx);
-#if ENABLE_EXT_texure_compression_s3tc
if (mesaCtx->Mesa_DXTn) {
- _mesa_enable_extension(mesaCtx, "GL_EXT_texture_compression_s3tc");
- _mesa_enable_extension(mesaCtx, "GL_S3_s3tc");
+ mesaCtx->Extensions.EXT_texture_compression_s3tc = GL_TRUE;
+ mesaCtx->Extensions.ANGLE_texture_compression_dxt = GL_TRUE;
}
- _mesa_enable_extension(mesaCtx, "GL_3DFX_texture_compression_FXT1");
-#endif
+ mesaCtx->Extensions.TDFX_texture_compression_FXT1 = GL_TRUE;
#if ENABLE_EXT_timer_query
- _mesa_enable_extension(mesaCtx, "GL_EXT_timer_query");
+ mesaCtx->Extensions.EXT_timer_query = GL_TRUE;
#endif
_mesa_meta_init(mesaCtx);
+ _mesa_compute_version(mesaCtx);
+
+ /* Exec table initialization requires the version to be computed */
+ _mesa_initialize_dispatch_tables(mesaCtx);
+ _mesa_initialize_vbo_vtxfmt(mesaCtx);
+
return c;
}
{
struct gl_renderbuffer *rb
= b->mesa_buffer.Attachment[BUFFER_DEPTH].Renderbuffer;
- if (!rb || !rb->Data) {
+ struct xmesa_renderbuffer *xrb = xmesa_renderbuffer(rb);
+
+ if (!xrb || !xrb->Base.Buffer) {
*width = 0;
*height = 0;
*bytesPerValue = 0;
*height = b->mesa_buffer.Height;
*bytesPerValue = b->mesa_buffer.Visual.depthBits <= 16
? sizeof(GLushort) : sizeof(GLuint);
- *buffer = rb->Data;
+ *buffer = (void *) xrb->Base.Buffer;
return GL_TRUE;
}
}