我试图以纯粹的方式制作https://learnopengl.com/Getting-started/TexturesC示例(讨厌C++),并在我的四边形中发现了这个奇怪的问题,其中一个一致的三角形渲染得很好,而另一个看起来像垂直的纹理坐标已被固定,同时水平方向也完美无缺。

meson.build:
project('snake', 'c',
version : '0.1',
default_options : ['warning_level=3'])
cc = meson.get_compiler('c')
m_dep = cc.find_library('m', required : true)
openGl = dependency('gl')
glfw3 = dependency('glfw3')
executable('snake',
'src/main.c',
'src/shaders.c',
'src/stb_image.c',
dependencies : [ m_dep, openGl, glfw3 ],
install : true)
Run Code Online (Sandbox Code Playgroud)
src/main.h:
#include <stdlib.h>
#include <stdio.h>
#include <GLFW/glfw3.h>
#include <sys/stat.h>
#include "shaders.h"
#include "stb_image.h"
// https://learnopengl.com/Getting-started/Transformations
static void error_callback(int error, const char* description) {
fprintf(stderr, "ERROR: Beschreibung: %s und Code: %i\n", description, error);
}
static …Run Code Online (Sandbox Code Playgroud) 我试图从https://haskell-at-work.com/episodes/2018-01-19-domain-modelling-with-haskell-data-structs.html中删除 Database.sh 文件中的 do 表示法
但我遇到了错误,我不知道为什么。(可能只是意味着我不了解 Haskell)
这是Haskell 从 do notation 到 Applicative的延续
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
module Project where
import Data.Text (Text)
newtype Money = Money
{ unMoney :: Double
} deriving (Show, Eq, Num)
newtype ProjectId = ProjectId
{ unProjectId :: Int
} deriving (Show, Eq, Num)
data Project
= Project ProjectId
Text
| ProjectGroup Text
[Project]
deriving (Show, Eq)
data Budget = Budget
{ budgetIncome :: Money
, budgetExpenditure :: Money
} deriving …Run Code Online (Sandbox Code Playgroud)