From 37b6643df2df7d784a31ca73f7bb90dc109c2401 Mon Sep 17 00:00:00 2001 From: Hans-Christoph Steiner Date: Thu, 15 Dec 2005 07:26:47 +0000 Subject: removing PDP source (except debian files) before import of PDP 0.12.4 svn path=/trunk/externals/pdp/; revision=4217 --- opengl/system/pdp_3Dcontext_common.c | 267 ----------------------------------- 1 file changed, 267 deletions(-) delete mode 100644 opengl/system/pdp_3Dcontext_common.c (limited to 'opengl/system/pdp_3Dcontext_common.c') diff --git a/opengl/system/pdp_3Dcontext_common.c b/opengl/system/pdp_3Dcontext_common.c deleted file mode 100644 index 185e2be..0000000 --- a/opengl/system/pdp_3Dcontext_common.c +++ /dev/null @@ -1,267 +0,0 @@ - -/* - * OpenGL Extension Module for pdp - pbuffer packet implementation - * Copyright (c) by Tom Schouten - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - * - */ - -/* - this code uses glx. i don't know if it is worth to take into - account portabiliy. since it will take a while until pdp runs - on anything else than linux. but in any case, providing a windows/osx - implementation here should not be too difficult.. -*/ - -#include "pdp_3Dcontext.h" -#include -//#include -#include -//#include - -#define D if (0) - -/* constructor */ - -/* pbuf operators */ - -u32 pdp_packet_3Dcontext_width(int packet) -{ - t_3Dcontext *c = pdp_packet_3Dcontext_info(packet); - if (c) return c->width; - else return 0; -} - -u32 pdp_packet_3Dcontext_height(int packet) -{ - t_3Dcontext *c = pdp_packet_3Dcontext_info(packet); - if (c) return c->height; - else return 0; -} - -u32 pdp_packet_3Dcontext_subwidth(int packet) -{ - t_3Dcontext *c = pdp_packet_3Dcontext_info(packet); - if (c) return c->sub_width; - else return 0; -} - - -u32 pdp_packet_3Dcontext_subheight(int packet) -{ - t_3Dcontext *c = pdp_packet_3Dcontext_info(packet); - if (c) return c->sub_height; - else return 0; -} - - -void pdp_packet_3Dcontext_set_subwidth(int packet, u32 w) -{ - t_3Dcontext *c = pdp_packet_3Dcontext_info(packet); - if (c) c->sub_width = w; -} - - -void pdp_packet_3Dcontext_set_subheight(int packet, u32 h) -{ - t_3Dcontext *c = pdp_packet_3Dcontext_info(packet); - if (c) c->sub_height = h; -} - - -float pdp_packet_3Dcontext_subaspect(int packet) -{ - t_3Dcontext *c = pdp_packet_3Dcontext_info(packet); - if (c) return (float)c->sub_width/c->sub_height; - else return 0; -} - -int pdp_packet_3Dcontext_isvalid(int packet) -{ - t_pdp *header = pdp_packet_header(packet); - t_3Dcontext *c = pdp_packet_3Dcontext_info(packet); - - if (!header) return 0; - if (!c) return 0; - if (PDP_3DCONTEXT != header->type) return 0; - return 1; -} - -t_3Dcontext *pdp_packet_3Dcontext_info(int packet) -{ - t_pdp *header = pdp_packet_header(packet); - if (!header) return 0; - if (PDP_3DCONTEXT != header->type) return 0; - return (t_3Dcontext *)&header->info.raw; -} - - - -void pdp_llconv_flip_top_bottom(char *data, int width, int height, int pixelsize); - -int pdp_packet_3Dcontext_snap_to_bitmap(int packet, int w, int h) -{ - int x, y, new_p, i; - char *data = 0; - // char r; - // int extra = 5; - - if (!pdp_packet_3Dcontext_isvalid(packet)) goto error; - - x = pdp_packet_3Dcontext_subwidth(packet); - y = pdp_packet_3Dcontext_subheight(packet); - - x = (x - w) >> 1; - y = (y - h) >> 1; - x = (x < 0 ) ? 0 : x; - y = (y < 0 ) ? 0 : y; - - new_p = pdp_packet_new_bitmap_rgb(w, h); - data = (char *)pdp_packet_data(new_p); - if (-1 == new_p || !data) goto error; - pdp_packet_3Dcontext_set_rendering_context(packet); - - // D post("BEGIN READPIXELS %d %d %d %d %x", w, h, x, y, data); - - //for (i=0; i