所以这个是doozie;
我有一个非常大的OpenGL解决方案,在Windows 7中使用GLSL 1.5编写的3.2版本核心.我使用GLEW和GLM作为帮助库.当我创建一个窗口时,我使用以下行:
// Initialize main window
glewExperimental = GL_TRUE;
glfwOpenWindowHint(GLFW_OPENGL_VERSION_MAJOR, 3); // Use OpenGL Core v3.2
glfwOpenWindowHint(GLFW_OPENGL_VERSION_MINOR, 2);
glfwOpenWindowHint(GLFW_OPENGL_PROFILE, GLFW_OPENGL_CORE_PROFILE);
if(!glfwOpenWindow(Game::WINDOW_X, Game::WINDOW_Y, 0, 0, 0, 0, 32, 0, GLFW_WINDOW))
{ ...
Run Code Online (Sandbox Code Playgroud)
如果我省略了三个glfwOpenWindowHint函数,应用程序在调用glDrawArrays(GL_TRIANGLES,0,m_numIndices)时会崩溃我的视频驱动程序;
但这是踢球者.当我的组中的其他人尝试更新并运行解决方案时,他们会得到一个没有几何体的空白窗口.注释掉这三行会使程序运行正常.使用3.2核心提示和不使用3.2核心提示之间存在相当分歧.我无法确定nVidia,AMD,台式机或笔记本电脑之间的任何差异.
我能找到的最好的建议是添加glewExperimental = GL_TRUE; 据说Glew有核心问题.它没有任何区别.解决方案太大而无法发布代码,但我可以根据需要设置着色器,渲染代码等.
非常感谢!这已经杀了我们好几天了.
我正在尝试使用以下代码更改我的TabControl的选定选项卡:
// Switch to configuration tab
tabControl.SelectedItem = configTab;
Run Code Online (Sandbox Code Playgroud)
虽然它可以在ButtonClick处理程序中正常工作,但它在同一个TabItem上的DataGrid DoubleClick处理程序中不执行任何操作.我已将调试器设置为此行,并且可以看到SelectedItem属性更改,但选项卡拒绝更改.
编辑:更多代码
选项卡控件定义如下:
<Grid>
<TabControl Height="Auto" HorizontalAlignment="Stretch" Name="tabControl" VerticalAlignment="Stretch" Width="Auto" Padding="0" SelectionChanged="BuildSummary">
<TabItem Header="Configurations" Name="configTab">
...
</TabItem>
<TabItem Header="Temperature" Name="tempTab">
...
</TabItem>
<TabItem Header="Test List" Name="testTab">
...
</TabItem>
<TabItem Header="Summary" Name="summaryTab">
...
</TabItem>
</TabControl>
</Grid>
Run Code Online (Sandbox Code Playgroud)
这是工作活动:
private void Execute(object sender, RoutedEventArgs e)
{
// Switch to configuration tab
tabControl.SelectedItem = configTab;
}
Run Code Online (Sandbox Code Playgroud)
这是破碎的事件:
private void DoubleClick(object sender, MouseButtonEventArgs e)
{
DataGridRow row = ItemsControl.ContainerFromElement(
(DataGrid)sender, e.OriginalSource as DependencyObject)
as …Run Code Online (Sandbox Code Playgroud) 这是我正在使用的示例程序中的着色器:
static const char* pFS = " \n\
#version 330 \n\
\n\
const int MAX_POINT_LIGHTS = 2; \n\
const int MAX_SPOT_LIGHTS = 2; \n\
\n\
in vec4 LightSpacePos; \n\
in vec2 TexCoord0; \n\
in vec3 Normal0; \n\
in vec3 WorldPos0; \n\
in vec3 Tangent0; \n\
\n\
out vec4 FragColor; \n\
\n\
struct BaseLight \n\
{ \n\
vec3 Color; \n\
float AmbientIntensity; \n\
float DiffuseIntensity; \n\
}; \n\
\n\
struct DirectionalLight \n\
{ \n\
struct BaseLight Base; \n\
vec3 Direction; \n\ …Run Code Online (Sandbox Code Playgroud)