view data/model/SDLWidget.h @ 151:f2d2c1084e7c

very good zoom out :P
author benoitrigolleau
date Wed, 14 Nov 2007 17:27:42 +0000
parents e63e8272dcb0
children 2ac52ea3c1c4
line wrap: on
line source
#ifndef _SDL_WIDGET_H
#define _SDL_WIDGET_H
#include <QWidget>
#include <QShowEvent>
#include <QTimer>

#ifdef WIN32
#include <SDL.h>
#endif
#ifdef __unix__
#include <SDL/SDL.h>
#endif
#undef main

class SDLWidget : public QWidget
{
	Q_OBJECT

public:
	SDLWidget();
	virtual ~SDLWidget();
	void setInitSize(int w, int h);

signals:
	void sizeChanged(int w, int h);
	void zoomfactorChanged(float factor);
	void initSizeChanged();

public slots:
  void setZoomFactor( float );
  void wheelEvent( QWheelEvent* );

protected:
	
	bool windowInitialized;
	SDL_Surface *screen;
	int m_width;
	int m_height;

	virtual void showEvent(QShowEvent *e);

protected slots:
		void updateMinSize();

private:
  float m_zoomFactor;
};


#endif