Added a GetGLProcAddress() method to BGLView.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@38578 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -46,6 +46,7 @@ public:
|
||||
void SwapBuffers(bool vSync);
|
||||
|
||||
BView* EmbeddedView(); // deprecated, returns NULL
|
||||
void* GetGLProcAddress(const char* procName);
|
||||
|
||||
status_t CopyPixelsOut(BPoint source, BBitmap *dest);
|
||||
status_t CopyPixelsIn(BBitmap *source, BPoint dest);
|
||||
@@ -82,6 +83,7 @@ virtual status_t GetSupportedSuites(BMessage *data);
|
||||
|
||||
virtual void GetPreferredSize(float* width, float* height);
|
||||
|
||||
|
||||
private:
|
||||
|
||||
virtual void _ReservedGLView1();
|
||||
|
||||
+21
-25
@@ -8,30 +8,6 @@
|
||||
* Stefano Ceccherini, [email protected]
|
||||
*/
|
||||
|
||||
/*
|
||||
* Mesa 3-D graphics library
|
||||
* Version: 6.1
|
||||
*
|
||||
* Copyright (C) 1999-2004 Brian Paul All Rights Reserved.
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
* copy of this software and associated documentation files (the "Software"),
|
||||
* to deal in the Software without restriction, including without limitation
|
||||
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
||||
* and/or sell copies of the Software, and to permit persons to whom the
|
||||
* Software is furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included
|
||||
* in all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
||||
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
||||
* BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
|
||||
* AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
||||
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
*/
|
||||
|
||||
|
||||
#include <GLView.h>
|
||||
|
||||
@@ -43,6 +19,7 @@
|
||||
#include <GLRenderer.h>
|
||||
|
||||
#include "DirectWindowPrivate.h"
|
||||
#include "GLDispatcher.h"
|
||||
#include "GLRendererRoster.h"
|
||||
|
||||
struct glview_direct_info {
|
||||
@@ -129,6 +106,21 @@ BGLView::EmbeddedView()
|
||||
}
|
||||
|
||||
|
||||
void*
|
||||
BGLView::GetGLProcAddress(const char* procName)
|
||||
{
|
||||
BGLDispatcher* glDispatcher = NULL;
|
||||
|
||||
if (fRenderer)
|
||||
glDispatcher = fRenderer->GLDispatcher();
|
||||
|
||||
if (glDispatcher)
|
||||
return (void*)glDispatcher->AddressOf(procName);
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
||||
status_t
|
||||
BGLView::CopyPixelsOut(BPoint source, BBitmap *dest)
|
||||
{
|
||||
@@ -207,8 +199,11 @@ BGLView::AttachedToWindow()
|
||||
#else
|
||||
SetViewColor(0, 0, 0);
|
||||
#endif
|
||||
|
||||
// Set default OpenGL viewport:
|
||||
LockGL();
|
||||
glViewport(0, 0, Bounds().IntegerWidth(), Bounds().IntegerHeight());
|
||||
UnlockGL();
|
||||
fRenderer->FrameResized(Bounds().IntegerWidth(),
|
||||
Bounds().IntegerHeight());
|
||||
|
||||
@@ -461,7 +456,8 @@ void BGLView::_ReservedGLView8() {}
|
||||
// #pragma mark -
|
||||
|
||||
|
||||
// BeOS compatibility
|
||||
// BeOS compatibility: contrary to others BView's contructors,
|
||||
// BGLView one wants a non-const name argument.
|
||||
BGLView::BGLView(BRect rect, char* name, ulong resizingMode, ulong mode,
|
||||
ulong options)
|
||||
:
|
||||
|
||||
Reference in New Issue
Block a user