~ubuntu-branches/ubuntu/gutsy/blender/gutsy-security

« back to all changes in this revision

Viewing changes to source/blender/src/swapbuffers.c

  • Committer: Bazaar Package Importer
  • Author(s): Florian Ernst
  • Date: 2005-11-06 12:40:03 UTC
  • mfrom: (1.1.2 upstream)
  • Revision ID: james.westby@ubuntu.com-20051106124003-3pgs7tcg5rox96xg
Tags: 2.37a-1.1
* Non-maintainer upload.
* Split out parts of 01_SConstruct_debian.dpatch again: root_build_dir
  really needs to get adjusted before the clean target runs - closes: #333958,
  see #288882 for reference

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/**
2
 
 * $Id: swapbuffers.c,v 1.6 2003/06/13 16:51:22 ton Exp $
 
2
 * $Id: swapbuffers.c,v 1.14 2005/04/17 18:00:33 ton Exp $
3
3
 *
4
4
 * ***** BEGIN GPL/BL DUAL LICENSE BLOCK *****
5
5
 *
40
40
 
41
41
 
42
42
#include <stdlib.h>
 
43
#include <stdio.h>
43
44
 
44
45
#ifdef HAVE_CONFIG_H
45
46
#include <config.h>
46
47
#endif
47
48
 
48
 
#ifdef WIN32
49
 
#include "BLI_winstuff.h"
50
 
#endif
51
 
 
52
49
#include "DNA_space_types.h"
53
50
#include "DNA_screen_types.h"
54
51
 
72
69
        winlay_get_winsize(&winx, &winy);
73
70
        
74
71
        if (actually_swap) {
75
 
                data= malloc(4*winx*winy);
 
72
                data= MEM_mallocN(4*winx*winy, "swap");
76
73
                glReadPixels(0, 0, winx, winy, GL_RGBA, GL_UNSIGNED_BYTE, data);
77
74
        }
78
75
        
82
79
        glDrawBuffer(GL_FRONT);
83
80
        glCopyPixels(0, 0, winx, winy, GL_COLOR);
84
81
        glDrawBuffer(GL_BACK);
85
 
        glFinish();
 
82
        glFlush();
86
83
 
87
84
        if (actually_swap) {
88
85
                glRasterPos2f(-0.5,-0.5);
89
86
                glDrawPixels(winx, winy, GL_RGBA, GL_UNSIGNED_BYTE, data);
90
 
                glFinish();
91
 
                free(data);
 
87
                glFlush();
 
88
                MEM_freeN(data);
92
89
        }
93
90
}
94
91
#endif
114
111
        while(sa) {
115
112
                swap= sa->win_swap;
116
113
                if( (swap & WIN_BACK_OK) == 0) {
117
 
                        
118
114
                        scrarea_do_windraw(sa);
119
115
 
120
116
                        doswap= 1;