Changeset 26 for trunk/Classes/SDL/src/video/uikit/SDL_uikitopengles.m
- Timestamp:
- 2010-05-28 07:39:52 (2 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Classes/SDL/src/video/uikit/SDL_uikitopengles.m
r4 r26 31 31 32 32 static int UIKit_GL_Initialize(_THIS); 33 34 extern UIView *gLandscapeView; 35 UIView *gLandscapeView; 36 37 extern unsigned char gFlippedGL; 33 38 34 39 void * … … 86 91 /* since now we've got something to draw 87 92 make the window visible */ 88 [data->uiwindow makeKeyAndVisible];93 // [data->uiwindow makeKeyAndVisible]; 89 94 90 95 /* we need to let the event cycle run, or the OS won't update the OpenGL view! */ … … 111 116 data->view = view; 112 117 118 113 119 /* add the view to our window */ 114 120 [data->uiwindow addSubview: view ]; … … 121 127 return NULL; 122 128 } 129 130 // KP: added here 131 132 #ifdef __IPAD__ 133 CGRect frameRect = CGRectMake(0.0, 0.0, 1024.0, 768.0); 134 #else 135 CGRect frameRect = CGRectMake(0.0, 0.0, 480.0, 320.0); 136 #endif 137 data->landscapeView = [[UIView alloc] initWithFrame: frameRect]; 138 CGAffineTransform tr = data->landscapeView.transform; // get current transform (portrait) 139 if (gFlippedGL) 140 tr = CGAffineTransformRotate(tr, -(M_PI / 2.0)); // rotate 90 degrees to go landscape 141 else 142 tr = CGAffineTransformRotate(tr, (M_PI / 2.0)); // rotate 90 degrees to go landscape 143 144 data->landscapeView.transform = tr; // set current transform (landscape) 145 data->landscapeView.center = data->uiwindow.center; 146 147 148 UIView* clearView = [[UIView alloc] initWithFrame:frameRect]; 149 clearView.backgroundColor = [UIColor colorWithRed:0.1f green:0.1f blue:0.1f alpha:0.75f]; 150 [data->landscapeView addSubview:clearView]; 151 152 [data->uiwindow addSubview:data->landscapeView]; 153 154 [data->uiwindow makeKeyAndVisible]; 155 156 gLandscapeView = data->landscapeView; 157 gLandscapeView.hidden = YES; 123 158 124 159 return view;
Note: See TracChangeset
for help on using the changeset viewer.