OpenGL Use in glEnable(GL_DEPTH_TEST) Post depth testing didn't work , Found that the depth buffer was not created .glut Library in compatibility mode (GL_COMPATIBILITY_PROFILE) Next displaymode The default value is GL_INDEX,GL_SINGLE,GL_DEPTH, And I'm using the core model (GL_CORE_PROFILE), In the specified dispalymode When using :

glutInitDisplayMode(GL_RGB);

Only the color reality mode is specified . If you want to create a depth buffer to , Need to specify GL_DEPTH, namely

glutInitDisplayMode(GL_RGB|GL_DEPTH);

glutInitDisplayMode In addition to specifying the window color display mode and depth buffer , You can also specify a template buffer (GL_STENCIL) And some other parameters ( Refer to the official website ).

glut In depth testing all works. More articles about problem solving

  1. MyEclipse2014 Quick configuration Spring & Spring Testing, Spring AOP Easy to use

    1. New projects 2. Right-click on the project , Pictured , utilize myeclipse Automatic import spring 3. In the pop-up dialog box all the time next In the end , Check... On the last page Spring Testing, complete . 4. stay src Under the appli ...

  2. MyEclipse2014 High speed configuration Spring & Spring Testing, Spring AOP Easy to use

    1. New projects 2. Right-click on the project , Pictured , utilize myeclipse Introduce yourself spring 3. In the pop-up dialog box all the time next In the end , Check... On the last page Spring Testing, complete . watermark/2 ...

  3. @JsonIgnoreProperties Solutions to problems where annotations don't work

    Recently, we need to call the third party service interface , To develop with reference to the interface documentation , But the interface field names of third-party services are all in uppercase , I thought there should be no problem with this . However, in the actual development, it is found that when calling the background interface with the uppercase field name : org.codeh ...

  4. 13-linux The solution to the problem that timed tasks don't work

    The basic operation is as follows : centos Timing task - It doesn't work - There's no path !!! The biggest problem is the path problem , And authority issues . There are a series of problems in executing some scripts with timed tasks , Step by step . Question 1 : The timed mission didn't respond : Check the log ...

  5. Use Visual Studio Debugging breakpoints don't work. Solutions debugging Revit CAD Cannot enter breakpoint

    With Visual Studio 2010 The official release , I believe many people have upgraded to Visual Studio 2010. So you're using VS2010 stay AutoCAD,Map 3D or Revit Of .net application ...

  6. windows hosts Role and common problem solving

    To borrow Baidu Encyclopedia's explanation Hosts Is a system file without an extension , You can use Notepad and other tools to open , Its function is to match the domain names of some commonly used websites with IP The address establishes an association “ database ”, When the user enters a web address to log in in the browser , System ...

  7. PyQt(Python+Qt) Learning essays : Layout control layout Of layoutSizeConstraint The solution to the problem that attributes don't work

    stay <PyQt(Python+Qt) Learning essays : Layout control layout Of layoutSizeConstraint attribute > Described in the layout Of layoutSizeConstraint After attribute , Repeat the test ...

  8. At the command line django-admin.py The problem of parameters not working is solved

    django official turial Create local web Site time , Use the following command django-admin.py startproject mysite Let's talk about a few problems I encountered in using : 1. Unable to find django-a ...

  9. SpringMVC Of JSP On the page EL Solving the problem that the expression doesn't work

    Original address :https://blog.csdn.net/sinat_35512245/article/details/53611663

Random recommendation

  1. utilize jQuery When extending plug-ins , Method $.extend()、$.fn.extend() Differences and connections

      utilize JQ How to develop plug-ins : 1.jQuery.extend(); 2.jQuery.fn.extend(); 3. adopt $.widget() application jQuery UI Part factory way to create . Because the third way is through ...

  2. [ primary ]SQLite Get database version 2

    This series of articles mainly use C++ Language to call its API, To get a glimpse of the leopard . In addition, the development environment used in this paper is mac + clion, And based on SQLite 3.7.14 To develop . One . To download sqlite-amalgam ...

  3. Use SchemaSpy Reverse engineering generates database dependencies using SchemaSpy Tools can be quickly obtained from the database

    Use SchemaSpy Reverse engineering generates database dependencies     Use SchemaSpy Tools can quickly get table dependencies from the database , At the same time, a vivid “ Chart ” Combined reports . Easy to quickly understand the relationship between database objects in the database , class ...

  4. javascript Based on learning ( Ten )

    javascript The array of Learning points : Introduction to array Define an array Array elements Array method One . Introduction to array The element type in an array can be numeric . String type . Boolean, etc , It could even be an array . Two . Define an array 1. Through the array ...

  5. First time to know redux trend redux-react

    I don't say much nonsense , Previous picture First of all to remember redux design idea Web Application is a state machine , Views and transitions are one-to-one correspondence All the transitions , Stored in an object 1.store A container for storing data , There is only one application state,Redux ...

  6. 51Nod 1815 Investigation mission

    People who find Shaoyi love to do 51nod, I have to say that this is a very versatile conscience OJ But I have no conscience at all , It's a cancer , All morning First of all, let's consider a path \(a_x\ mod\ a_y\) It's worth the most , We are simple ...

  7. [No0000EA]C# Null type (Nullable)

    C# Null type (Nullable) C# Provides a special data type ,nullable  type ( Null type ), Nullable types can represent values in the normal range of their underlying value types , Add one more null value . for example ,Nullable& ...

  8. centos The host name suddenly becomes bogon Solutions for

    The host name suddenly becomes bogon, There may be problems accessing the network ( Maybe not , Mine is fine ), Services that may use a host name ( for instance :mysql) There may also be inaccessibility .   So we need to solve the following problems , My solution : Host name ...

  9. SVM Code implementation of -python

    After a long time, the wood has been renewed , Because I found myself numpy I forgot a lot about it , Plus, I've been a little busy lately ... Then last time The iteration function we get is First j != yi j = yi import numpy as np def sv ...

  10. Lei Linpeng shares :C# Anonymous methods

    C# Anonymous methods We have already mentioned , A delegate is used to refer to a method that has the same label as it . let me put it another way , You can use a delegate object to call methods that can be referenced by a delegate . Anonymous methods (Anonymous methods) Provides a way to pass code blocks as delegates ...