{-# LANGUAGE CApiFFI #-}
{-# LANGUAGE PatternSynonyms #-}
-- This file was generated by dear-bindings-ffi. Do not edit by hand.
module DearImGui.Raw.Impl.OpenGL3
( ImGui_ImplOpenGL3_RenderState (..)
, createDeviceObjects
, destroyDeviceObjects
, getRenderState
, init
, newFrame
, renderDrawData
, setClipOrigin
, shutdown
, updateTexture
) where
import DearImGui.Raw.ImDrawData (ImDrawData)
import DearImGui.Raw.ImTextureData (ImTextureData)
import Foreign.C.String (CString)
import Foreign.C.Types
import Foreign.Ptr (Ptr, plusPtr)
import Foreign.Storable (Storable (..))
import GHC.Records (HasField (..))
import Prelude hiding (init)
#include "dcimgui_impl_opengl3.h"
-- structs (opaque)
data {-# CTYPE "dcimgui_impl_opengl3.h" "ImGui_ImplOpenGL3_RenderState" #-} ImGui_ImplOpenGL3_RenderState = ImGui_ImplOpenGL3_RenderState
{ useBindSampler :: CBool
, useTexParameterFilter :: CBool
, currentSampler :: CUInt
, currentTexParameterFilter :: CUInt
}
deriving (Eq, Show)
instance Storable ImGui_ImplOpenGL3_RenderState where
sizeOf _ = #{size ImGui_ImplOpenGL3_RenderState}
alignment _ = #{alignment ImGui_ImplOpenGL3_RenderState}
peek p = ImGui_ImplOpenGL3_RenderState <$> #{peek ImGui_ImplOpenGL3_RenderState, UseBindSampler} p <*> #{peek ImGui_ImplOpenGL3_RenderState, UseTexParameterFilter} p <*> #{peek ImGui_ImplOpenGL3_RenderState, CurrentSampler} p <*> #{peek ImGui_ImplOpenGL3_RenderState, CurrentTexParameterFilter} p
poke p v = do
#{poke ImGui_ImplOpenGL3_RenderState, UseBindSampler} p v.useBindSampler
#{poke ImGui_ImplOpenGL3_RenderState, UseTexParameterFilter} p v.useTexParameterFilter
#{poke ImGui_ImplOpenGL3_RenderState, CurrentSampler} p v.currentSampler
#{poke ImGui_ImplOpenGL3_RenderState, CurrentTexParameterFilter} p v.currentTexParameterFilter
instance HasField "useBindSampler" (Ptr ImGui_ImplOpenGL3_RenderState) (Ptr CBool) where
getField = #{ptr ImGui_ImplOpenGL3_RenderState, UseBindSampler}
instance HasField "useTexParameterFilter" (Ptr ImGui_ImplOpenGL3_RenderState) (Ptr CBool) where
getField = #{ptr ImGui_ImplOpenGL3_RenderState, UseTexParameterFilter}
instance HasField "currentSampler" (Ptr ImGui_ImplOpenGL3_RenderState) (Ptr CUInt) where
getField = #{ptr ImGui_ImplOpenGL3_RenderState, CurrentSampler}
instance HasField "currentTexParameterFilter" (Ptr ImGui_ImplOpenGL3_RenderState) (Ptr CUInt) where
getField = #{ptr ImGui_ImplOpenGL3_RenderState, CurrentTexParameterFilter}
-- functions
-- C: bool ImGui_ImplOpenGL3_CreateDeviceObjects()
foreign import capi safe "dcimgui_impl_opengl3.h cImGui_ImplOpenGL3_CreateDeviceObjects"
createDeviceObjects :: IO CBool
-- C: void ImGui_ImplOpenGL3_DestroyDeviceObjects()
foreign import capi safe "dcimgui_impl_opengl3.h cImGui_ImplOpenGL3_DestroyDeviceObjects"
destroyDeviceObjects :: IO ()
-- C: ImGui_ImplOpenGL3_RenderState* ImGui_ImplOpenGL3_GetRenderState()
foreign import capi safe "dcimgui_impl_opengl3.h cImGui_ImplOpenGL3_GetRenderState"
getRenderState :: IO (Ptr ImGui_ImplOpenGL3_RenderState)
-- C: bool ImGui_ImplOpenGL3_Init(const char* glsl_version)
foreign import capi safe "dcimgui_impl_opengl3.h cImGui_ImplOpenGL3_Init"
init
:: CString -- ^ glsl_version
-> IO CBool
-- C: void ImGui_ImplOpenGL3_NewFrame()
foreign import capi safe "dcimgui_impl_opengl3.h cImGui_ImplOpenGL3_NewFrame"
newFrame :: IO ()
-- C: void ImGui_ImplOpenGL3_RenderDrawData(ImDrawData* draw_data)
foreign import capi safe "dcimgui_impl_opengl3.h cImGui_ImplOpenGL3_RenderDrawData"
renderDrawData
:: (Ptr ImDrawData) -- ^ draw_data
-> IO ()
-- C: void ImGui_ImplOpenGL3_SetClipOrigin(unsigned int gl_clip_origin)
foreign import capi safe "dcimgui_impl_opengl3.h cImGui_ImplOpenGL3_SetClipOrigin"
setClipOrigin
:: CUInt -- ^ gl_clip_origin
-> IO ()
-- C: void ImGui_ImplOpenGL3_Shutdown()
foreign import capi safe "dcimgui_impl_opengl3.h cImGui_ImplOpenGL3_Shutdown"
shutdown :: IO ()
-- C: void ImGui_ImplOpenGL3_UpdateTexture(ImTextureData* tex)
foreign import capi safe "dcimgui_impl_opengl3.h cImGui_ImplOpenGL3_UpdateTexture"
updateTexture
:: (Ptr ImTextureData) -- ^ tex
-> IO ()