430N/A/*
2362N/A * Copyright (c) 2007, 2008, Oracle and/or its affiliates. All rights reserved.
430N/A * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
430N/A *
430N/A * This code is free software; you can redistribute it and/or modify it
430N/A * under the terms of the GNU General Public License version 2 only, as
2362N/A * published by the Free Software Foundation. Oracle designates this
430N/A * particular file as subject to the "Classpath" exception as provided
2362N/A * by Oracle in the LICENSE file that accompanied this code.
430N/A *
430N/A * This code is distributed in the hope that it will be useful, but WITHOUT
430N/A * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
430N/A * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
430N/A * version 2 for more details (a copy is included in the LICENSE file that
430N/A * accompanied this code).
430N/A *
430N/A * You should have received a copy of the GNU General Public License version
430N/A * 2 along with this work; if not, write to the Free Software Foundation,
430N/A * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
430N/A *
2362N/A * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
2362N/A * or visit www.oracle.com if you need additional information or have any
2362N/A * questions.
430N/A */
430N/A
430N/A#ifndef D3DRenderQueue_h_Included
430N/A#define D3DRenderQueue_h_Included
430N/A
430N/A#include "D3DContext.h"
430N/A#include "D3DSurfaceData.h"
430N/A
430N/A/*
430N/A * The following macros are used to pick values (of the specified type) off
430N/A * the queue.
430N/A */
430N/A#define NEXT_VAL(buf, type) (((type *)((buf) += sizeof(type)))[-1])
430N/A#define NEXT_BYTE(buf) NEXT_VAL(buf, unsigned char)
430N/A#define NEXT_INT(buf) NEXT_VAL(buf, jint)
430N/A#define NEXT_FLOAT(buf) NEXT_VAL(buf, jfloat)
430N/A#define NEXT_BOOLEAN(buf) (jboolean)NEXT_INT(buf)
430N/A#define NEXT_LONG(buf) NEXT_VAL(buf, jlong)
430N/A#define NEXT_DOUBLE(buf) NEXT_VAL(buf, jdouble)
430N/A
430N/A/*
430N/A * Increments a pointer (buf) by the given number of bytes.
430N/A */
430N/A#define SKIP_BYTES(buf, numbytes) buf += (numbytes)
430N/A
430N/A/*
430N/A * Extracts a value at the given offset from the provided packed value.
430N/A */
430N/A#define EXTRACT_VAL(packedval, offset, mask) \
430N/A (((packedval) >> (offset)) & (mask))
430N/A#define EXTRACT_BYTE(packedval, offset) \
430N/A (unsigned char)EXTRACT_VAL(packedval, offset, 0xff)
430N/A#define EXTRACT_BOOLEAN(packedval, offset) \
430N/A (jboolean)EXTRACT_VAL(packedval, offset, 0x1)
430N/A
430N/AD3DContext *D3DRQ_GetCurrentContext();
430N/AD3DSDOps *D3DRQ_GetCurrentDestination();
430N/Avoid D3DRQ_ResetCurrentContextAndDestination();
430N/AHRESULT D3DRQ_MarkLostIfNeeded(HRESULT res, D3DSDOps *d3dops);
430N/A
430N/A#endif /* D3DRenderQueue_h_Included */