Oolite 1.91.0.7604-240417-a536cbe
Loading...
Searching...
No Matches
OOGraphicsResetManager.h
Go to the documentation of this file.
1/*
2
3OOGraphicsResetManager.h
4
5Tracks objects with state that needs to be reset when the graphics context is
6modified (for instance, when switching between windowed and full-screen mode
7in SDL builds). This means re-uploading all textures, and also resetting any
8display lists relying on old texture names. All objects which have display
9lists must therefore register with the OOGraphicsResetManager on init, and
10unregister on dealloc.
11
12
13Copyright (C) 2007-2013 Jens Ayton and contributors
14
15Permission is hereby granted, free of charge, to any person obtaining a copy
16of this software and associated documentation files (the "Software"), to deal
17in the Software without restriction, including without limitation the rights
18to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
19copies of the Software, and to permit persons to whom the Software is
20furnished to do so, subject to the following conditions:
21
22The above copyright notice and this permission notice shall be included in all
23copies or substantial portions of the Software.
24
25THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
26IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
27FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
28AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
29LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
30OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
31SOFTWARE.
32
33*/
34
35#import "OOCocoa.h"
36
37
38@protocol OOGraphicsResetClient
39
40- (void) resetGraphicsState;
41
42@end
43
44
45@interface OOGraphicsResetManager: NSObject
46{
47@private
48 NSMutableSet *clients;
49}
50
51+ (OOGraphicsResetManager *) sharedManager;
52
53// Clients are not retained.
54- (void) registerClient:(id<OOGraphicsResetClient>)client;
55- (void) unregisterClient:(id<OOGraphicsResetClient>)client;
56
57// Forwarded to all clients, after resetting textures.
58- (void) resetGraphicsState;
59
60@end