Change to make the view visible when testing, but not to allow it to use

OpenGL, since we don't want to introduce an unecessary dependency.


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/apps/gorm/trunk@21334 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Gregory John Casamento 2005-06-21 00:04:36 +00:00
parent c1c8b949d8
commit eb44c977c5
4 changed files with 18 additions and 9 deletions

View file

@ -1,3 +1,9 @@
2005-06-20 20:11 Gregory John Casamento <greg_casamento@yahoo.com>
* GNUmakefile.preamble: Remove dependency on GL.
* GormCore/GormOpenGLView.h: Make a subclass of NSView.
* GormCore/GormOpenGLView.m: Comment out uneeded code.
2005-06-20 19:32 Gregory John Casamento <greg_casamento@yahoo.com> 2005-06-20 19:32 Gregory John Casamento <greg_casamento@yahoo.com>
* GNUmakefile.preamble: Add -lGL to ADDITIONAL_LIBS * GNUmakefile.preamble: Add -lGL to ADDITIONAL_LIBS

View file

@ -28,8 +28,7 @@ ADDITIONAL_GUI_LIBS += \
-lGormCore \ -lGormCore \
-lGorm \ -lGorm \
-lGormObjCHeaderParser \ -lGormObjCHeaderParser \
-lGormPrefs \ -lGormPrefs
-lGL
ADDITIONAL_INCLUDE_DIRS += \ ADDITIONAL_INCLUDE_DIRS += \
-IInterfaceBuilder \ -IInterfaceBuilder \

View file

@ -26,11 +26,11 @@
#ifndef INCLUDED_GormOpenGLView_h #ifndef INCLUDED_GormOpenGLView_h
#define INCLUDED_GormOpenGLView_h #define INCLUDED_GormOpenGLView_h
#include <AppKit/NSOpenGLView.h> #include <AppKit/NSView.h>
@class NSTimer; @class NSTimer;
@interface GormOpenGLView : NSOpenGLView @interface GormOpenGLView : NSView
{ {
float rtri; float rtri;
NSTimer *timer; NSTimer *timer;

View file

@ -25,27 +25,30 @@
#include <GormCore/GormOpenGLView.h> #include <GormCore/GormOpenGLView.h>
#include <Foundation/NSTimer.h> #include <Foundation/NSTimer.h>
#include <AppKit/NSOpenGL.h> #include <AppKit/PSOperators.h>
#include <GL/gl.h> // #include <AppKit/NSOpenGL.h>
// #include <GL/gl.h>
@implementation GormOpenGLView @implementation GormOpenGLView
- (id) initWithFrame: (NSRect)rect - (id) initWithFrame: (NSRect)rect
{ {
if((self = [super initWithFrame: rect]) != nil) if((self = [super initWithFrame: rect]) != nil)
{ {
/*
rtri = 0.0f; rtri = 0.0f;
timer = [NSTimer scheduledTimerWithTimeInterval: 0.05 timer = [NSTimer scheduledTimerWithTimeInterval: 0.05
target: self target: self
selector: @selector(oneStep) selector: @selector(oneStep)
userInfo: nil userInfo: nil
repeats: YES]; repeats: YES];
*/
} }
return self; return self;
} }
- (void) dealloc - (void) dealloc
{ {
[timer invalidate]; // [timer invalidate];
[super dealloc]; [super dealloc];
} }
@ -53,14 +56,15 @@
{ {
// rotate. // rotate.
// rtri -= 0.2f; // rtri -= 0.2f;
rtri = 0.5f; // fabs( sin( 2.0 * M_PI * [startTime timeIntervalSinceNow] ) ) ; rtri = 0.5f;
[self setNeedsDisplay: YES]; [self setNeedsDisplay: YES];
} }
- (void) drawRect: (NSRect)rect - (void) drawRect: (NSRect)rect
{ {
// do nothing for now... // do nothing for now...
[[NSColor blackColor] set];
PSrectfill(NSMinX(rect), NSMinY(rect), NSWidth(rect), NSHeight(rect));
} }
@end @end