Changeset 72997
- Timestamp:
- Jul 19, 2018, 7:18:06 AM (6 years ago)
- Location:
- grass/trunk
- Files:
-
- 2 edited
-
include/nviz.h (modified) (1 diff)
-
lib/nviz/render.c (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
grass/trunk/include/nviz.h
r72966 r72997 135 135 HDC displayId; /* display context */ 136 136 HGLRC contextId; /* rendering context */ 137 HBITMAP bitmapId;138 137 #endif 139 138 int width, height; -
grass/trunk/lib/nviz/render.c
r72970 r72997 51 51 rwin->displayId = NULL; 52 52 rwin->contextId = NULL; 53 rwin->bitmapId = NULL;54 53 #endif 55 54 … … 78 77 wglDeleteContext(rwin->contextId); 79 78 DeleteDC(rwin->displayId); 80 DeleteObject(rwin->bitmapId);81 79 #endif 82 80 … … 148 146 aglCreatePBuffer(width, height, GL_TEXTURE_2D, GL_RGBA, 0, &(rwin->windowId)); 149 147 #elif defined(OPENGL_WINDOWS) 148 WNDCLASS wc = {0}; 149 HWND hWnd; 150 150 PIXELFORMATDESCRIPTOR pfd = { 151 151 sizeof(PIXELFORMATDESCRIPTOR), // size of this pfd 152 152 1, /* version number */ 153 153 PFD_DRAW_TO_WINDOW | /* support window */ 154 PFD_SUPPORT_OPENGL | /* support OpenGL */155 PFD_DOUBLEBUFFER, /* double buffered */154 PFD_SUPPORT_OPENGL | /* support OpenGL */ 155 PFD_DOUBLEBUFFER, /* double buffered */ 156 156 PFD_TYPE_RGBA, /* RGBA type */ 157 157 24, /* 24-bit color depth */ … … 170 170 int iPixelFormat; 171 171 172 rwin->displayId = CreateCompatibleDC(NULL); 172 wc.lpfnWndProc = DefWindowProc; 173 wc.lpszClassName = "nviz"; 174 175 if (!RegisterClass(&wc)) { 176 G_warning(_("Unable to register window class")); 177 return -1; 178 } 179 180 hWnd = CreateWindow(wc.lpszClassName, wc.lpszClassName, WS_POPUP, 181 CW_USEDEFAULT, CW_USEDEFAULT, width, height, 182 NULL, NULL, wc.hInstance, NULL); 183 184 if (!hWnd) { 185 G_warning(_("Unable to create window")); 186 return -1; 187 } 188 189 rwin->displayId = GetDC(hWnd); 173 190 iPixelFormat = ChoosePixelFormat(rwin->displayId, &pfd); 174 191 SetPixelFormat(rwin->displayId, iPixelFormat, &pfd); 175 rwin->bitmapId = CreateCompatibleBitmap(rwin->displayId, width, height);176 SelectObject(rwin->displayId, rwin->bitmapId);177 192 rwin->contextId = wglCreateContext(rwin->displayId); 178 /* TODO */179 193 #endif 180 194
Note:
See TracChangeset
for help on using the changeset viewer.
