PEBL 2.2
Psychology Experiment Building Language - Cross-platform psychological experiment development system
sdl/PlatformWindow.h
Go to the documentation of this file.
1//* -*- mode:C++; tab-width:4; c-basic-offset:4; indent-tabs-mode:nil -*- */
3// Name: src/platforms/sdl/PlatformWindow.h
4// Purpose: Contains platform-specific Main window
5// Author: Shane T. Mueller, Ph.D.
6// Copyright: (c) 2003-2026 Shane T. Mueller <smueller@obereed.net>
7// License: GPL 2
8//
9//
10//
11// This file is part of the PEBL project.
12//
13// PEBL is free software; you can redistribute it and/or modify
14// it under the terms of the GNU General Public License as published by
15// the Free Software Foundation; either version 2 of the License, or
16// (at your option) any later version.
17//
18// PEBL is distributed in the hope that it will be useful,
19// but WITHOUT ANY WARRANTY; without even the implied warranty of
20// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21// GNU General Public License for more details.
22//
23// You should have received a copy of the GNU General Public License
24// along with PEBL; if not, write to the Free Software
25// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
27#ifndef __PLATFORMWINDOW_H__
28#define __PLATFORMWINDOW_H__
29
30
31#include "PlatformWidget.h"
32#include "PlatformEnvironment.h"
33#include "../../base/PEBLObject.h"
34#include "../../objects/PWindow.h"
35#include "../../objects/PColor.h"
36
37
38#include "../../apps/Globals.h"
39#include "SDL.h"
40
41
45
46
47
48class PlatformWindow: virtual public PWindow, virtual public PlatformWidget
49{
50
51public:
52
55
56
58 bool Initialize(PEBLVideoMode mode,
59 PEBLVideoDepth vdepth,
60 bool windowed,
61 bool resizeable,
62 unsigned int width,
63 unsigned int height);
64
65 int GetVideoFlags();
66
67 bool Resize(int w, int h);
68
69 bool Draw();
70 long int DrawFor(unsigned int cycles);
71
72 SDL_Window * GetSDLWindow(){return mWindow;};
73
74 int SaveScreenShot(int x, int y, int w, int h,const Variant fname);
75
76protected:
77 virtual std::ostream & SendToStream(std::ostream& out) const;
78 virtual std::string ObjectName() const{return "PlatformWindow";};
79
80
81private:
82
83 int mFlags;
84 SDL_Window * mWindow;
85};
86
87
88
89#endif
PEBLVideoDepth
Definition Globals.h:69
PEBLVideoMode
Definition Globals.h:58
virtual std::ostream & SendToStream(std::ostream &out) const
An inheritable printing class used by PEBLObjectBase::operator<<.
virtual std::string ObjectName() const
bool Resize(int w, int h)
int SaveScreenShot(int x, int y, int w, int h, const Variant fname)
bool Initialize(PEBLVideoMode mode, PEBLVideoDepth vdepth, bool windowed, bool resizeable, unsigned int width, unsigned int height)
This method initiates everything needed to display the main window.
SDL_Window * GetSDLWindow()
long int DrawFor(unsigned int cycles)
~PlatformWindow()
Standard Destructor.