Compare commits
7 Commits
f17acc45e0
...
dev
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
f09e348de8 | ||
|
|
d9d14bdc94 | ||
|
|
2d299d4ced | ||
|
|
cea8ba3354 | ||
|
|
66b9e70c8c | ||
|
|
472eb1c70d | ||
|
|
2b84809d84 |
38
flake.lock
generated
38
flake.lock
generated
@@ -5,11 +5,11 @@
|
|||||||
"nixpkgs-lib": "nixpkgs-lib"
|
"nixpkgs-lib": "nixpkgs-lib"
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1767609335,
|
"lastModified": 1769996383,
|
||||||
"narHash": "sha256-feveD98mQpptwrAEggBQKJTYbvwwglSbOv53uCfH9PY=",
|
"narHash": "sha256-AnYjnFWgS49RlqX7LrC4uA+sCCDBj0Ry/WOJ5XWAsa0=",
|
||||||
"owner": "hercules-ci",
|
"owner": "hercules-ci",
|
||||||
"repo": "flake-parts",
|
"repo": "flake-parts",
|
||||||
"rev": "250481aafeb741edfe23d29195671c19b36b6dca",
|
"rev": "57928607ea566b5db3ad13af0e57e921e6b12381",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
@@ -25,11 +25,11 @@
|
|||||||
"nixpkgs": "nixpkgs"
|
"nixpkgs": "nixpkgs"
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1769198512,
|
"lastModified": 1770911191,
|
||||||
"narHash": "sha256-ZsQm3CwvicJBv4CMJJzRkTcYYcrghqzVabL9IehNz9k=",
|
"narHash": "sha256-fePV3+4uHg1tQH83rUO/7gQOGexHdaxyVkO2X3HkOA0=",
|
||||||
"owner": "well-typed",
|
"owner": "well-typed",
|
||||||
"repo": "hs-bindgen",
|
"repo": "hs-bindgen",
|
||||||
"rev": "f99ed4ddfc7808b3eb28bbf089612b6a52983685",
|
"rev": "087884c110948e7bd67bec0ae8004e5396f63241",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
@@ -41,27 +41,27 @@
|
|||||||
"libclang-bindings-src": {
|
"libclang-bindings-src": {
|
||||||
"flake": false,
|
"flake": false,
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1768982090,
|
"lastModified": 1770274896,
|
||||||
"narHash": "sha256-EgM9ZJvbM0+SQ8f9P27Rnx4dY8Q1fWtGVXsRl5f0Vfk=",
|
"narHash": "sha256-JnxJBo2L4URFD8JbpjnPG/ej/xKFe7y5ZpjnvIztwAM=",
|
||||||
"owner": "well-typed",
|
"owner": "well-typed",
|
||||||
"repo": "libclang",
|
"repo": "libclang",
|
||||||
"rev": "27f20c2e320f779314175ee3e82072fec61b8391",
|
"rev": "155642a4a4a9f0414a058a8f08f39aa6c7bb57ed",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
"owner": "well-typed",
|
"owner": "well-typed",
|
||||||
"repo": "libclang",
|
"repo": "libclang",
|
||||||
"rev": "27f20c2e320f779314175ee3e82072fec61b8391",
|
"rev": "155642a4a4a9f0414a058a8f08f39aa6c7bb57ed",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"nixpkgs": {
|
"nixpkgs": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1767364772,
|
"lastModified": 1770169770,
|
||||||
"narHash": "sha256-fFUnEYMla8b7UKjijLnMe+oVFOz6HjijGGNS1l7dYaQ=",
|
"narHash": "sha256-awR8qIwJxJJiOmcEGgP2KUqYmHG4v/z8XpL9z8FnT1A=",
|
||||||
"owner": "NixOS",
|
"owner": "NixOS",
|
||||||
"repo": "nixpkgs",
|
"repo": "nixpkgs",
|
||||||
"rev": "16c7794d0a28b5a37904d55bcca36003b9109aaa",
|
"rev": "aa290c9891fa4ebe88f8889e59633d20cc06a5f2",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
@@ -73,11 +73,11 @@
|
|||||||
},
|
},
|
||||||
"nixpkgs-lib": {
|
"nixpkgs-lib": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1765674936,
|
"lastModified": 1769909678,
|
||||||
"narHash": "sha256-k00uTP4JNfmejrCLJOwdObYC9jHRrr/5M/a/8L2EIdo=",
|
"narHash": "sha256-cBEymOf4/o3FD5AZnzC3J9hLbiZ+QDT/KDuyHXVJOpM=",
|
||||||
"owner": "nix-community",
|
"owner": "nix-community",
|
||||||
"repo": "nixpkgs.lib",
|
"repo": "nixpkgs.lib",
|
||||||
"rev": "2075416fcb47225d9b68ac469a5c4801a9c4dd85",
|
"rev": "72716169fe93074c333e8d0173151350670b824c",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
@@ -88,11 +88,11 @@
|
|||||||
},
|
},
|
||||||
"nixpkgs_2": {
|
"nixpkgs_2": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1765772535,
|
"lastModified": 1770843696,
|
||||||
"narHash": "sha256-aq+dQoaPONOSjtFIBnAXseDm9TUhIbe215TPmkfMYww=",
|
"narHash": "sha256-LovWTGDwXhkfCOmbgLVA10bvsi/P8eDDpRudgk68HA8=",
|
||||||
"owner": "NixOS",
|
"owner": "NixOS",
|
||||||
"repo": "nixpkgs",
|
"repo": "nixpkgs",
|
||||||
"rev": "09b8fda8959d761445f12b55f380d90375a1d6bb",
|
"rev": "2343bbb58f99267223bc2aac4fc9ea301a155a16",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
|||||||
59
flake.nix
59
flake.nix
@@ -10,50 +10,6 @@
|
|||||||
self,
|
self,
|
||||||
...
|
...
|
||||||
}: let
|
}: let
|
||||||
version = "0.1.0";
|
|
||||||
package = {
|
|
||||||
# nix stuff
|
|
||||||
mkDerivation,
|
|
||||||
lib,
|
|
||||||
# haskell deps
|
|
||||||
base,
|
|
||||||
c-expr-runtime,
|
|
||||||
hs-bindgen-runtime,
|
|
||||||
# pkgconfig deps
|
|
||||||
libGL,
|
|
||||||
libX11,
|
|
||||||
libXcursor,
|
|
||||||
libXi,
|
|
||||||
xrandr,
|
|
||||||
# shell deps
|
|
||||||
hs-bindgen-cli,
|
|
||||||
}:
|
|
||||||
mkDerivation {
|
|
||||||
pname = "hs-rgfw";
|
|
||||||
inherit version;
|
|
||||||
src = ./.;
|
|
||||||
libraryHaskellDepends = [
|
|
||||||
base
|
|
||||||
c-expr-runtime
|
|
||||||
hs-bindgen-runtime
|
|
||||||
];
|
|
||||||
libraryPkgconfigDepends = [
|
|
||||||
libGL
|
|
||||||
libX11
|
|
||||||
libXcursor
|
|
||||||
libXi
|
|
||||||
xrandr
|
|
||||||
];
|
|
||||||
preBuild = ''
|
|
||||||
set -x
|
|
||||||
export PATH=${hs-bindgen-cli}/bin:$PATH
|
|
||||||
./generate.sh
|
|
||||||
set +x
|
|
||||||
'';
|
|
||||||
homepage = "https://git.mtgmonkey.net/Andromeda/hs-rgfw";
|
|
||||||
license = lib.licenses.gpl3Only;
|
|
||||||
platforms = ["x86_64-linux"];
|
|
||||||
};
|
|
||||||
system = "x86_64-linux";
|
system = "x86_64-linux";
|
||||||
pkgs = import nixpkgs {
|
pkgs = import nixpkgs {
|
||||||
inherit system;
|
inherit system;
|
||||||
@@ -67,6 +23,8 @@
|
|||||||
default = pkgs.mkShell {
|
default = pkgs.mkShell {
|
||||||
stdenv = pkgs.clangStdenv;
|
stdenv = pkgs.clangStdenv;
|
||||||
packages = [
|
packages = [
|
||||||
|
pkgs.haskellPackages.ghcide
|
||||||
|
pkgs.haskellPackages.ormolu
|
||||||
pkgs.clang
|
pkgs.clang
|
||||||
pkgs.cabal-install
|
pkgs.cabal-install
|
||||||
pkgs.hs-bindgen-cli
|
pkgs.hs-bindgen-cli
|
||||||
@@ -78,7 +36,18 @@
|
|||||||
};
|
};
|
||||||
};
|
};
|
||||||
packages.${system} = {
|
packages.${system} = {
|
||||||
default = pkgs.haskellPackages.callPackage package {};
|
default =
|
||||||
|
(pkgs.haskell.packages.ghc912.callCabal2nix "hs-rgfw" ./. {
|
||||||
|
xi = pkgs.libxi;
|
||||||
|
gl = pkgs.libGL;
|
||||||
|
xcursor = pkgs.libxcursor;
|
||||||
|
xrandr = pkgs.xrandr;
|
||||||
|
}).overrideAttrs {
|
||||||
|
preConfigure = ''
|
||||||
|
export PATH=${pkgs.clang}/bin:${pkgs.hs-bindgen-cli}/bin:${pkgs.tree}/bin:$PATH
|
||||||
|
./generate.sh
|
||||||
|
'';
|
||||||
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
39
generate.sh
39
generate.sh
@@ -1,22 +1,49 @@
|
|||||||
echo "# copying header..."
|
echo "# copying header..."
|
||||||
|
|
||||||
mkdir lib
|
mkdir -p lib/include
|
||||||
mkdir lib/include
|
|
||||||
cp rgfw/RGFW.h lib/include/RGFW.h
|
cp rgfw/RGFW.h lib/include/RGFW.h
|
||||||
|
|
||||||
echo "# creating c file to generate from..."
|
echo "# creating flags for hs-bindgen-cli..."
|
||||||
|
|
||||||
clang -E -DRGFW_IMPLEMENTATION -DRGFW_OPENGL lib/include/RGFW.h -o lib/include/RGFW.c
|
export CFLAGS=$(pkg-config --cflags x11 xcursor xrandr xi gl xrender xext xfixes)
|
||||||
|
HBC_ARGS=""
|
||||||
|
|
||||||
|
for token in $CFLAGS; do
|
||||||
|
case "$token" in
|
||||||
|
-I* ) HBC_ARGS="$HBC_ARGS $token" ;;
|
||||||
|
-D* ) HBC_ARGS="$HBC_ARGS --define-macro ${token#-D}" ;;
|
||||||
|
* ) HBC_ARGS="$HBC_ARGS --clang-option $token" ;;
|
||||||
|
esac
|
||||||
|
done
|
||||||
|
|
||||||
|
echo "# creating c file from header..."
|
||||||
|
|
||||||
|
# other macro definitions should be defined with ghc-options: -copt-D in *.cabal
|
||||||
|
cat > lib/RGFW.c <<EOF
|
||||||
|
#define RGFW_IMPLEMENTATION
|
||||||
|
#include "RGFW.h"
|
||||||
|
EOF
|
||||||
|
|
||||||
echo "# generating library RGFW.Generated..."
|
echo "# generating library RGFW.Generated..."
|
||||||
|
|
||||||
|
# --unsafe _unsafe \
|
||||||
|
# --pointer _pointer \
|
||||||
|
set -x
|
||||||
hs-bindgen-cli preprocess \
|
hs-bindgen-cli preprocess \
|
||||||
-Ilib/include \
|
-Ilib/include \
|
||||||
|
--unique-id andromeda.hs-rgfw \
|
||||||
--create-output-dirs \
|
--create-output-dirs \
|
||||||
--overwrite-files \
|
--overwrite-files \
|
||||||
|
--single-file \
|
||||||
|
--safe _safe \
|
||||||
--hs-output-dir lib \
|
--hs-output-dir lib \
|
||||||
--module RGFW.Generated \
|
--module RGFW.Generated \
|
||||||
--clang-option=-DRGFW_OPENGL \
|
--define-macro=RGFW_OPENGL \
|
||||||
--clang-option=-DRGFW_EXPORT \
|
--define-macro=RGFW_EXPORT \
|
||||||
|
$HBC_ARGS \
|
||||||
RGFW.h
|
RGFW.h
|
||||||
|
set +x
|
||||||
|
|
||||||
|
echo "# generated filetree:"
|
||||||
|
|
||||||
|
tree lib
|
||||||
|
|||||||
@@ -12,29 +12,39 @@ common warnings
|
|||||||
|
|
||||||
library
|
library
|
||||||
import: warnings
|
import: warnings
|
||||||
exposed-modules:
|
-- hs-bindgen-cli uses --single-file flag, so no other modules
|
||||||
, RGFW.Generated
|
exposed-modules: RGFW.Generated
|
||||||
, RGFW.Generated.FunPtr
|
|
||||||
, RGFW.Generated.Safe
|
|
||||||
, RGFW.Generated.Unsafe
|
|
||||||
build-depends:
|
build-depends:
|
||||||
, base
|
, base
|
||||||
, primitive
|
, primitive
|
||||||
, c-expr-runtime
|
, c-expr-runtime
|
||||||
, hs-bindgen-runtime
|
, hs-bindgen-runtime
|
||||||
include-dirs: lib/include
|
pkgconfig-depends:
|
||||||
hs-source-dirs: lib
|
, gl
|
||||||
default-language: Haskell2010
|
, x11
|
||||||
default-extensions: FlexibleInstances
|
, xcursor
|
||||||
|
, xrandr
|
||||||
executable hs-rgfw
|
, xi
|
||||||
import: warnings
|
include-dirs: lib/include
|
||||||
main-is: Main.hs
|
hs-source-dirs: lib
|
||||||
build-depends:
|
default-language: Haskell2010
|
||||||
, base
|
default-extensions: FlexibleInstances
|
||||||
, hs-rgfw
|
-- options for RGFW passed here
|
||||||
, c-expr-runtime
|
ghc-options:
|
||||||
, hs-bindgen-runtime
|
-optc-DRGFW_OPENGL
|
||||||
|
-optc-DRGFW_EXPORT
|
||||||
|
c-sources: lib/RGFW.c
|
||||||
|
|
||||||
|
executable hs-rgfw
|
||||||
|
import: warnings
|
||||||
|
main-is: Main.hs
|
||||||
|
build-depends:
|
||||||
|
, base
|
||||||
|
, bytestring
|
||||||
|
, c-expr-runtime
|
||||||
|
, hs-bindgen-runtime
|
||||||
|
, hs-rgfw
|
||||||
|
, OpenGL
|
||||||
pkgconfig-depends:
|
pkgconfig-depends:
|
||||||
, gl
|
, gl
|
||||||
, x11
|
, x11
|
||||||
|
|||||||
2
rgfw
2
rgfw
Submodule rgfw updated: 83d945ae89...a971541830
91
src/LoadShaders.hs
Normal file
91
src/LoadShaders.hs
Normal file
@@ -0,0 +1,91 @@
|
|||||||
|
--------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
--------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
-- |
|
||||||
|
-- Module : LoadShaders
|
||||||
|
-- Copyright : (c) Sven Panne 2013
|
||||||
|
-- License : BSD3
|
||||||
|
--
|
||||||
|
-- Maintainer : Sven Panne <svenpanne@gmail.com>
|
||||||
|
-- Stability : stable
|
||||||
|
-- Portability : portable
|
||||||
|
--
|
||||||
|
-- Utilities for shader handling, adapted from LoadShaders.cpp which is (c) The
|
||||||
|
-- Red Book Authors.
|
||||||
|
module LoadShaders
|
||||||
|
( ShaderSource (..),
|
||||||
|
ShaderInfo (..),
|
||||||
|
loadShaders,
|
||||||
|
)
|
||||||
|
where
|
||||||
|
|
||||||
|
import Control.Exception
|
||||||
|
import Control.Monad
|
||||||
|
import qualified Data.ByteString as B
|
||||||
|
import Graphics.Rendering.OpenGL
|
||||||
|
|
||||||
|
--------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
-- | The source of the shader source code.
|
||||||
|
data ShaderSource
|
||||||
|
= -- | The shader source code is directly given as a 'B.ByteString'.
|
||||||
|
ByteStringSource B.ByteString
|
||||||
|
| -- | The shader source code is directly given as a 'String'.
|
||||||
|
StringSource String
|
||||||
|
| -- | The shader source code is located in the file at the given 'FilePath'.
|
||||||
|
FileSource FilePath
|
||||||
|
deriving (Eq, Ord, Show)
|
||||||
|
|
||||||
|
getSource :: ShaderSource -> IO B.ByteString
|
||||||
|
getSource (ByteStringSource bs) = return bs
|
||||||
|
getSource (StringSource str) = return $ packUtf8 str
|
||||||
|
getSource (FileSource path) = B.readFile path
|
||||||
|
|
||||||
|
--------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
-- | A description of a shader: The type of the shader plus its source code.
|
||||||
|
data ShaderInfo
|
||||||
|
= ShaderInfo ShaderType ShaderSource
|
||||||
|
deriving (Eq, Ord, Show)
|
||||||
|
|
||||||
|
--------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
-- | Create a new program object from the given shaders, throwing an
|
||||||
|
-- 'IOException' if something goes wrong.
|
||||||
|
loadShaders :: [ShaderInfo] -> IO Program
|
||||||
|
loadShaders infos =
|
||||||
|
createProgram `bracketOnError` deleteObjectName $ \program -> do
|
||||||
|
loadCompileAttach program infos
|
||||||
|
linkAndCheck program
|
||||||
|
return program
|
||||||
|
|
||||||
|
linkAndCheck :: Program -> IO ()
|
||||||
|
linkAndCheck = checked linkProgram linkStatus programInfoLog "link"
|
||||||
|
|
||||||
|
loadCompileAttach :: Program -> [ShaderInfo] -> IO ()
|
||||||
|
loadCompileAttach _ [] = return ()
|
||||||
|
loadCompileAttach program (ShaderInfo shType source : infos) =
|
||||||
|
createShader shType `bracketOnError` deleteObjectName $ \shader -> do
|
||||||
|
src <- getSource source
|
||||||
|
shaderSourceBS shader $= src
|
||||||
|
compileAndCheck shader
|
||||||
|
attachShader program shader
|
||||||
|
loadCompileAttach program infos
|
||||||
|
|
||||||
|
compileAndCheck :: Shader -> IO ()
|
||||||
|
compileAndCheck = checked compileShader compileStatus shaderInfoLog "compile"
|
||||||
|
|
||||||
|
checked ::
|
||||||
|
(t -> IO ()) ->
|
||||||
|
(t -> GettableStateVar Bool) ->
|
||||||
|
(t -> GettableStateVar String) ->
|
||||||
|
String ->
|
||||||
|
t ->
|
||||||
|
IO ()
|
||||||
|
checked action getStatus getInfoLog message object = do
|
||||||
|
action object
|
||||||
|
ok <- get (getStatus object)
|
||||||
|
unless ok $ do
|
||||||
|
infoLog <- get (getInfoLog object)
|
||||||
|
fail (message ++ " log: " ++ infoLog)
|
||||||
89
src/Main.hs
89
src/Main.hs
@@ -1,10 +1,89 @@
|
|||||||
|
{-# LANGUAGE MultilineStrings #-}
|
||||||
|
|
||||||
module Main where
|
module Main where
|
||||||
|
|
||||||
import qualified Foreign.Ptr (ToFunPtr)
|
import Data.Bits ((.|.))
|
||||||
|
import Foreign.C.ConstPtr
|
||||||
import qualified RGFW.Generated as RGFW
|
import Foreign.C.String (newCString)
|
||||||
|
import Foreign.C.Types (CChar)
|
||||||
|
import Foreign.Ptr (Ptr)
|
||||||
|
import Graphics.Rendering.OpenGL (($=))
|
||||||
|
import qualified Graphics.Rendering.OpenGL as GL
|
||||||
|
import LoadShaders
|
||||||
|
import RGFW.Generated
|
||||||
|
|
||||||
main :: IO ()
|
main :: IO ()
|
||||||
main = do
|
main = do
|
||||||
putStrLn "Hello World"
|
putStrInfo "creating window"
|
||||||
window <- toFunPtr ()
|
-- string not freed; window remains open
|
||||||
|
windowTitle_cstr <- newCString "window"
|
||||||
|
let windowTitle_ptr = ConstPtr windowTitle_cstr
|
||||||
|
windowFlags = RGFW_windowFlags $ fromIntegral $ RGFW_windowCenter .|. RGFW_windowNoResize .|. RGFW_windowOpenGL
|
||||||
|
|
||||||
|
window <-
|
||||||
|
rGFW_createWindow_safe
|
||||||
|
windowTitle_ptr -- name
|
||||||
|
0 -- x
|
||||||
|
0 -- y
|
||||||
|
300 -- w
|
||||||
|
300 -- h
|
||||||
|
windowFlags -- flags
|
||||||
|
putStrDebug $ "windowFlags: " ++ (show $ unwrapU32 $ unwrapRGFW_windowFlags windowFlags)
|
||||||
|
putStrDebug $ "window: " ++ (show $ window)
|
||||||
|
putStrInfo "initialising shaders"
|
||||||
|
_ <- initResources
|
||||||
|
putStrInfo "entering loop"
|
||||||
|
loop window 0
|
||||||
|
|
||||||
|
loop :: Ptr RGFW_window -> Int -> IO ()
|
||||||
|
loop window i = do
|
||||||
|
view
|
||||||
|
rGFW_window_swapBuffers_OpenGL_safe window
|
||||||
|
loop window $ i + 1
|
||||||
|
|
||||||
|
putStrDebug :: String -> IO ()
|
||||||
|
putStrDebug a = putStrLn $ "[debug]:" ++ a
|
||||||
|
|
||||||
|
putStrInfo :: String -> IO ()
|
||||||
|
putStrInfo a = putStrLn $ "[info]:" ++ a
|
||||||
|
|
||||||
|
initResources :: IO GL.Program
|
||||||
|
initResources = do
|
||||||
|
program <-
|
||||||
|
loadShaders
|
||||||
|
[ ShaderInfo GL.VertexShader $ StringSource vertShader,
|
||||||
|
ShaderInfo GL.FragmentShader $ StringSource fragShader
|
||||||
|
]
|
||||||
|
GL.currentProgram $= Just program
|
||||||
|
return program
|
||||||
|
where
|
||||||
|
vertShader =
|
||||||
|
"""
|
||||||
|
#version 330 core
|
||||||
|
layout (location = 0) in vec3 aPos;
|
||||||
|
|
||||||
|
out vec4 vertexColor;
|
||||||
|
|
||||||
|
void main()
|
||||||
|
{
|
||||||
|
gl_Position = vec4(aPos, 1.0);
|
||||||
|
vertexColor = vec4(0.5, 0.0, 0.0, 1.0);
|
||||||
|
}
|
||||||
|
"""
|
||||||
|
fragShader =
|
||||||
|
"""
|
||||||
|
#version 330 core
|
||||||
|
out vec4 FragColor;
|
||||||
|
|
||||||
|
in vec4 vertexColor;
|
||||||
|
|
||||||
|
void main()
|
||||||
|
{
|
||||||
|
FragColor = vertexColor;
|
||||||
|
}
|
||||||
|
"""
|
||||||
|
|
||||||
|
view :: IO ()
|
||||||
|
view = do
|
||||||
|
GL.clearColor $= GL.Color4 1 0 1 1
|
||||||
|
GL.clear [GL.ColorBuffer, GL.DepthBuffer]
|
||||||
|
|||||||
Reference in New Issue
Block a user