File: util.h

package info (click to toggle)
forge 1.0.1-5
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 2,312 kB
  • sloc: cpp: 12,447; ansic: 319; xml: 182; makefile: 19
file content (93 lines) | stat: -rw-r--r-- 2,529 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
/*******************************************************
 * Copyright (c) 2015-2019, ArrayFire
 * All rights reserved.
 *
 * This file is distributed under 3-clause BSD license.
 * The complete license agreement can be obtained at:
 * http://arrayfire.com/licenses/BSD-3-Clause
 ********************************************************/

#pragma once

#include <fg/defines.h>

#ifdef __cplusplus
extern "C" {
#endif

/** \addtogroup util_functions
 * @{
 */

/**
    Update backend specific vertex buffer from given host side memory

    \param[in] pBufferId is the buffer identifier
    \param[in] pBufferSize is the buffer size in bytes
    \param[in] pBufferData is the pointer of the host side memory

    \return \ref fg_err error code
 */
FGAPI fg_err fg_update_vertex_buffer(const unsigned pBufferId,
                                     const size_t pBufferSize,
                                     const void* pBufferData);

/**
    Update backend specific pixel buffer from given host side memory

    \param[in] pBufferId is the buffer identifier
    \param[in] pBufferSize is the buffer size in bytes
    \param[in] pBufferData is the pointer of the host side memory

    \return \ref fg_err error code
 */
FGAPI fg_err fg_update_pixel_buffer(const unsigned pBufferId,
                                    const size_t pBufferSize,
                                    const void* pBufferData);

/**
    Sync all rendering operations till this point

    \return \ref fg_err error code
 */
FGAPI fg_err fg_finish();

/** @} */

#ifdef __cplusplus
}
#endif

#ifdef __cplusplus
namespace forge
{

/**
    Update backend specific vertex buffer from given host side memory

    \param[in] pBufferId is the buffer identifier
    \param[in] pBufferSize is the buffer size in bytes
    \param[in] pBufferData is the pointer of the host side memory
 */
FGAPI void updateVertexBuffer(const unsigned pBufferId,
                              const size_t pBufferSize,
                              const void* pBufferData);

/**
    Update backend specific pixel buffer from given host side memory

    \param[in] pBufferId is the buffer identifier
    \param[in] pBufferSize is the buffer size in bytes
    \param[in] pBufferData is the pointer of the host side memory
 */
FGAPI void updatePixelBuffer(const unsigned pBufferId,
                             const size_t pBufferSize,
                             const void* pBufferData);

/**
    Sync all rendering operations till this point
 */
FGAPI void finish();

}
#endif